Class BasicRabbitMqJmsImplementation

All Implemented Interfaces:
ComponentLifecycleExtension, ConnectionComparator<VendorImplementationBase>, VendorImplementation, VendorImplementationBase
Direct Known Subclasses:
AdvancedRabbitMqJmsImplementation

public class BasicRabbitMqJmsImplementation extends UrlVendorImplementation
AMQP 0.9.1 implementation of VendorImplementation 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 case ConnectionFactory.createConnection(String, String) is used when creating the connection otherwise ConnectionFactory.createConnection() will be used.

This was built against com.rabbitmq.jms:rabbitmq-jms:1.6.0 and com.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.

  • Field Details

  • Constructor Details

    • BasicRabbitMqJmsImplementation

      public BasicRabbitMqJmsImplementation()
  • Method Details

    • 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 interface ConnectionComparator<VendorImplementationBase>
      Overrides:
      connectionEquals in class UrlVendorImplementation
    • createQueue

      public javax.jms.Queue createQueue(String name, JmsActorConfig c) throws javax.jms.JMSException
      Specified by:
      createQueue in interface VendorImplementationBase
      Overrides:
      createQueue in class VendorImplementationImp
      Throws:
      javax.jms.JMSException
    • createTopic

      public javax.jms.Topic createTopic(String name, JmsActorConfig c) throws javax.jms.JMSException
      Specified by:
      createTopic in interface VendorImplementationBase
      Overrides:
      createTopic in class VendorImplementationImp
      Throws:
      javax.jms.JMSException
    • withAmqpMode

      public <T extends BasicRabbitMqJmsImplementation> T withAmqpMode(Boolean b)
    • amqpMode

      public boolean amqpMode()
    • createDestination

      protected com.rabbitmq.jms.admin.RMQDestination createDestination(String name, JmsActorConfig c, boolean isQueue) throws javax.jms.JMSException
      Throws:
      javax.jms.JMSException
    • builder

    • setAmqpMode

      public void setAmqpMode(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 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.