- java.lang.Object
-
- com.rabbitmq.jms.admin.RMQDestination
-
- All Implemented Interfaces:
jakarta.jms.Destination,jakarta.jms.Queue,jakarta.jms.TemporaryQueue,jakarta.jms.TemporaryTopic,jakarta.jms.Topic,java.io.Serializable,javax.naming.Referenceable
public class RMQDestination extends java.lang.Object implements jakarta.jms.Queue, jakarta.jms.Topic, jakarta.jms.Destination, javax.naming.Referenceable, java.io.Serializable, jakarta.jms.TemporaryQueue, jakarta.jms.TemporaryTopicImplementation of aTopicandQueueDestination.This implementation is
Serializableso it can be stored in a JNDI naming context. It is alsoReferenceablefor the same purpose.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RMQDestination()Constructor used only for Java serialisationRMQDestination(java.lang.String destName, boolean isQueue, boolean isTemporary)Creates a destination for RJMSRMQDestination(java.lang.String destName, boolean isQueue, boolean isTemporary, java.util.Map<java.lang.String,java.lang.Object> queueDeclareArguments)Creates a destination for RJMS with arguments to declare the AMQP queueRMQDestination(java.lang.String destName, java.lang.String amqpExchangeName, java.lang.String amqpRoutingKey, java.lang.String amqpQueueName)Creates a destination for RJMS mapped onto an AMQP queue/destination.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete()This method is forTemporaryQueues only — deletion currently occurs automatically on session close.booleanequals(java.lang.Object obj)java.lang.StringgetAmqpExchangeName()java.lang.StringgetAmqpExchangeType()Internal use onlyjava.lang.StringgetAmqpQueueName()java.lang.StringgetAmqpRoutingKey()java.lang.StringgetDestinationName()java.util.Map<java.lang.String,java.lang.Object>getQueueDeclareArguments()java.lang.StringgetQueueName()javax.naming.ReferencegetReference()java.lang.StringgetTopicName()inthashCode()booleanisAmqp()booleanisAmqpReadable()booleanisAmqpWritable()booleanisDeclared()For internal use only.booleanisQueue()booleanisTemporary()booleannoNeedToDeclareExchange()Internal use onlyvoidsetAmqp(boolean amqp)For JNDI binding and Spring beansvoidsetAmqpExchangeName(java.lang.String amqpExchangeName)For JNDI binding and Spring beansvoidsetAmqpQueueName(java.lang.String amqpQueueName)For JNDI binding and Spring beansvoidsetAmqpRoutingKey(java.lang.String routingKey)For JNDI binding and Spring beansvoidsetDeclared(boolean isDeclared)For internal use only.voidsetDestinationName(java.lang.String destinationName)For JNDI binding and Spring beansvoidsetQueue(boolean isQueue)Set to true if this is a queue, false if this is a topic - should only be used when binding into JNDIjava.lang.StringtoString()
-
-
-
Constructor Detail
-
RMQDestination
public RMQDestination()
Constructor used only for Java serialisation
-
RMQDestination
public RMQDestination(java.lang.String destName, boolean isQueue, boolean isTemporary)Creates a destination for RJMS- Parameters:
destName- the name of the topic or queueisQueue- true if this represent a queueisTemporary- true if this is a temporary destination
-
RMQDestination
public RMQDestination(java.lang.String destName, boolean isQueue, boolean isTemporary, java.util.Map<java.lang.String,java.lang.Object> queueDeclareArguments)Creates a destination for RJMS with arguments to declare the AMQP queue- Parameters:
destName- the name of the topic or queueisQueue- true if this represent a queueisTemporary- true if this is a temporary destinationqueueDeclareArguments- arguments to use when declaring the AMQP queue
-
RMQDestination
public RMQDestination(java.lang.String destName, java.lang.String amqpExchangeName, java.lang.String amqpRoutingKey, java.lang.String amqpQueueName)Creates a destination for RJMS mapped onto an AMQP queue/destination.amqpExchangeNameandamqpRoutingKeymust both benullif either isnull, andamqpQueueNamemay benull, but at least one of these three parameters must be non-null.- Parameters:
destName- the name of the queue destinationamqpExchangeName- - the exchange name for the mapped resourceamqpRoutingKey- - the routing key for the mapped resourceamqpQueueName- - the queue name of the mapped resource
-
-
Method Detail
-
isAmqpWritable
public boolean isAmqpWritable()
-
isAmqpReadable
public boolean isAmqpReadable()
-
isAmqp
public boolean isAmqp()
- Returns:
trueif this is an AMQP 0-9-1 mapped resource,falseotherwise
-
setAmqp
public void setAmqp(boolean amqp)
For JNDI binding and Spring beans- Parameters:
amqp- set totrueif this is an AMQP 0-9-1 mapped resource,falseotherwise
-
getAmqpQueueName
public java.lang.String getAmqpQueueName()
-
setAmqpQueueName
public void setAmqpQueueName(java.lang.String amqpQueueName)
For JNDI binding and Spring beans- Parameters:
amqpQueueName- AMQP 0-9-1 queue name
-
getAmqpExchangeName
public java.lang.String getAmqpExchangeName()
-
setAmqpExchangeName
public void setAmqpExchangeName(java.lang.String amqpExchangeName)
For JNDI binding and Spring beans- Parameters:
amqpExchangeName- AMQP 0-9-1 exchange name to use
-
getDestinationName
public java.lang.String getDestinationName()
-
setDestinationName
public void setDestinationName(java.lang.String destinationName)
For JNDI binding and Spring beans- Parameters:
destinationName- JMS destination name
-
getAmqpRoutingKey
public java.lang.String getAmqpRoutingKey()
- Returns:
- AMQP 0-9-1 routing key
-
setAmqpRoutingKey
public void setAmqpRoutingKey(java.lang.String routingKey)
For JNDI binding and Spring beans- Parameters:
routingKey- AMQP 0-9-1 routing key
-
getAmqpExchangeType
public java.lang.String getAmqpExchangeType()
Internal use only- Returns:
- AMQP 0-9-1 exchange type used
-
noNeedToDeclareExchange
public boolean noNeedToDeclareExchange()
Internal use only
-
isQueue
public boolean isQueue()
- Returns:
- true if this is a queue, false if it is a topic
-
setQueue
public void setQueue(boolean isQueue)
Set to true if this is a queue, false if this is a topic - should only be used when binding into JNDI- Parameters:
isQueue-trueif this is a queue,falseotherwise- Throws:
java.lang.IllegalStateException- if the queue has already been declaredisDeclared()return true
-
getTopicName
public java.lang.String getTopicName() throws jakarta.jms.JMSException- Specified by:
getTopicNamein interfacejakarta.jms.Topic- Throws:
jakarta.jms.JMSException
-
getQueueName
public java.lang.String getQueueName() throws jakarta.jms.JMSException- Specified by:
getQueueNamein interfacejakarta.jms.Queue- Throws:
jakarta.jms.JMSException
-
getReference
public javax.naming.Reference getReference() throws javax.naming.NamingException- Specified by:
getReferencein interfacejavax.naming.Referenceable- Throws:
javax.naming.NamingException
-
getQueueDeclareArguments
public java.util.Map<java.lang.String,java.lang.Object> getQueueDeclareArguments()
-
isDeclared
public boolean isDeclared()
For internal use only.- Returns:
- true if we have declared RabbitMQ resources to back this destination
-
setDeclared
public void setDeclared(boolean isDeclared)
For internal use only.- Parameters:
isDeclared- - set to true if the queue/topic has been defined in the RabbitMQ broker- See Also:
isDeclared()
-
isTemporary
public boolean isTemporary()
- Returns:
trueif this is a temporary destination,falseotherwise
-
delete
public void delete() throws jakarta.jms.JMSExceptionThis method is forTemporaryQueues only — deletion currently occurs automatically on session close.- Specified by:
deletein interfacejakarta.jms.TemporaryQueue- Specified by:
deletein interfacejakarta.jms.TemporaryTopic- Throws:
jakarta.jms.JMSException
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Specified by:
toStringin interfacejakarta.jms.Queue- Specified by:
toStringin interfacejakarta.jms.Topic- Overrides:
toStringin classjava.lang.Object
-
-