Class BasicRabbitMqJmsImplementation
- java.lang.Object
-
- com.adaptris.core.jms.VendorImplementationImp
-
- com.adaptris.core.jms.UrlVendorImplementation
-
- com.adaptris.core.amqp.rabbitmq.BasicRabbitMqJmsImplementation
-
- All Implemented Interfaces:
ComponentLifecycleExtension
,ConnectionComparator<VendorImplementationBase>
,VendorImplementation
,VendorImplementationBase
- Direct Known Subclasses:
AdvancedRabbitMqJmsImplementation
public class BasicRabbitMqJmsImplementation extends UrlVendorImplementation
AMQP 0.9.1 implementation ofVendorImplementation
using RabbitMQ.Everything required to configure the connection needs to be specified on the URL. If you configure a username and password on the wrapping
JmsConnection
in which caseConnectionFactory.createConnection(String, String)
is used when creating the connection otherwiseConnectionFactory.createConnection()
will be used.This was built against
com.rabbitmq.jms:rabbitmq-jms:1.6.0
andcom.rabbitmq:amqp-client:4.0.2
- Since:
- 3.6.0
In the adapter configuration file this class is aliased as rabbitmq-basic-jms-implementation which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interface
BasicRabbitMqJmsImplementation.RMQDestinationBuilder
-
Field Summary
Fields Modifier and Type Field Description protected static int
DEFAULT_OM_TIMEOUT
-
Fields inherited from class com.adaptris.core.jms.VendorImplementationImp
log
-
-
Constructor Summary
Constructors Constructor Description BasicRabbitMqJmsImplementation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
amqpMode()
protected BasicRabbitMqJmsImplementation.RMQDestinationBuilder
builder()
boolean
connectionEquals(VendorImplementationBase vendorImp)
com.rabbitmq.jms.admin.RMQConnectionFactory
createConnectionFactory()
protected com.rabbitmq.jms.admin.RMQDestination
createDestination(java.lang.String name, JmsActorConfig c, boolean isQueue)
javax.jms.Queue
createQueue(java.lang.String name, JmsActorConfig c)
javax.jms.Topic
createTopic(java.lang.String name, JmsActorConfig c)
java.lang.Boolean
getAmqpMode()
Force the underlying JMS destination to be interopable with AMQP.void
setAmqpMode(java.lang.Boolean amqpMode)
Force the underlying JMS destination to be interopable with AMQP.<T extends BasicRabbitMqJmsImplementation>
TwithAmqpMode(java.lang.Boolean b)
-
Methods inherited from class com.adaptris.core.jms.UrlVendorImplementation
getBrokerUrl, retrieveBrokerDetailsForLogging, setBrokerUrl
-
Methods inherited from class com.adaptris.core.jms.VendorImplementationImp
applyVendorSessionProperties, createConsumer, createDestination, createQueueReceiver, createSession, createTopicSubscriber, prepare
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.jms.VendorImplementation
createConnection
-
-
-
-
Field Detail
-
DEFAULT_OM_TIMEOUT
protected static final int DEFAULT_OM_TIMEOUT
- See Also:
- Constant Field Values
-
-
Method Detail
-
createConnectionFactory
public com.rabbitmq.jms.admin.RMQConnectionFactory createConnectionFactory() throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
-
connectionEquals
public boolean connectionEquals(VendorImplementationBase vendorImp)
- Specified by:
connectionEquals
in interfaceConnectionComparator<VendorImplementationBase>
- Overrides:
connectionEquals
in classUrlVendorImplementation
-
createQueue
public javax.jms.Queue createQueue(java.lang.String name, JmsActorConfig c) throws javax.jms.JMSException
- Specified by:
createQueue
in interfaceVendorImplementationBase
- Overrides:
createQueue
in classVendorImplementationImp
- Throws:
javax.jms.JMSException
-
createTopic
public javax.jms.Topic createTopic(java.lang.String name, JmsActorConfig c) throws javax.jms.JMSException
- Specified by:
createTopic
in interfaceVendorImplementationBase
- Overrides:
createTopic
in classVendorImplementationImp
- Throws:
javax.jms.JMSException
-
withAmqpMode
public <T extends BasicRabbitMqJmsImplementation> T withAmqpMode(java.lang.Boolean b)
-
amqpMode
public boolean amqpMode()
-
createDestination
protected com.rabbitmq.jms.admin.RMQDestination createDestination(java.lang.String name, JmsActorConfig c, boolean isQueue) throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
-
builder
protected BasicRabbitMqJmsImplementation.RMQDestinationBuilder builder()
-
setAmqpMode
public void setAmqpMode(java.lang.Boolean amqpMode)
Force the underlying JMS destination to be interopable with AMQP.Setting this to true changes queue and topic creation to use the
RMQDestination(String,String,String,String)
constructor. rather than delegating it to the underlying session. This allows interopability with AMQP senders such as bunny + JMS Producer/Consumers.Note the setting this to be true will still (under the covers) first use the JMS session to create a standard queue or topic (this has the effect of auto-declaring the required information within RabbitMQ first. After that it simply returns a
RMQDestination
with the specified name.The default is false if not specified.
-
getAmqpMode
public java.lang.Boolean getAmqpMode()
Force the underlying JMS destination to be interopable with AMQP.Setting this to true changes queue and topic creation to use the
RMQDestination(String,String,String,String)
constructor. rather than delegating it to the underlying session. This allows interopability with AMQP senders such as bunny + JMS Producer/Consumers.Note the setting this to be true will still (under the covers) first use the JMS session to create a standard queue or topic (this has the effect of auto-declaring the required information within RabbitMQ first. After that it simply returns a
RMQDestination
with the specified name.The default is false if not specified.
-
-