I want to switch the JMS implementation from ActiveMQ to Azure's Service Bus. Currently, we are using ActiveMQ but want to explore the option of switching
to Azure Service Bus. However, I'm getting exceptions when deploying my simple JMS application.
I'm using TomEE [8.5.32 (7.1.0)]. I include the AMQP 1.0 JMS client library jars to the lib directory of TomEE. (See: https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-java-how-to-use-jms-api-amqp)
I created a service-jar.xml as a jar file and copied it to the lib directory.(See: http://tomee.apache.org/changing-jms-implementations.html)
<?xml version="1.0" encoding="UTF-8"?><ServiceProvider id="ampq" service="Resource" types="AMPQJMSRA" class-name="org.jboss.resource.adapter.jms.JmsResourceAdapter"> UserName Password ProviderIntegrationMode ConnectionFactoryClassName QueueConnectionFactoryClassName TopicConnectionFactoryClassName XAConnectionFactoryClassName XAQueueConnectionFactoryClassName XATopicConnectionFactoryClassName UnifiedDestinationClassName TopicClassName QueueClassName SupportsXA ConnectionFactoryProperties JndiProperties CommonSetterMethodName RMPolicy LogLevel DeliveryType UseFirstXAForRedelivery</ServiceProvider><ServiceProvider id="ConnectionFactory" service="Resource" types="javax.jms.ConnectionFactory, javax.jms.QueueConnectionFactory, javax.jms.TopicConnectionFactory, QueueConnectionFactory, TopicConnectionFactory" class-name="org.apache.qpid.jms.JmsConnectionFactory"> RemoteURI Username Password ClientId ResourceAdapter</ServiceProvider><ServiceProvider id="Queue" service="Resource" types="javax.jms.Queue, Queue" class-name="org.apache.qpid.jms.JmsQueue"> DestinationJndiName ResourceAdapter UserName Password JndiProperties QueueClassName</ServiceProvider><ServiceProvider id="Topic" service="Resource" types="javax.jms.Topic, Topic" class-name="org.apache.qpid.jms.JmsTopic"> DestinationJndiName ResourceAdapter UserName Password JndiProperties TopicClassName</ServiceProvider></ServiceJar>
Then I added the following to tomee.xml:
<Container id="myJmsMdbContainer" type="MESSAGE"> ResourceAdapter=amqpsRA MessageListenerInterface=javax.jms.MessageListener ActivationSpecClass=org.jboss.resource.adapter.jms.inflow.JmsActivationSpec</Container><Resource id="amqpsRA" type="AMPQJMSRA" provider="com.wk.amsp:ampq"> RemoteURI=amqps://xxxxxx.servicebus.windows.net?amqp.idleTimeout=120000&amqp.traceFrames=true UserName=********* Password=*********</Resource><Resource id="MyJmsConnectionFactory" type="javax.jms.ConnectionFactory" provider="com.wk.amsp:ConnectionFactory"> ResourceAdapter = amqpsRA</Resource><Resource id="MyQueue" type="javax.jms.Queue"/><Resource id="MyTopic" type="javax.jms.Topic"/>
Unfortunately, when I deploy my JMS application I get the following exception:
Unable to create activation spec: connectionFactory is mandatory
Has anyone been able to get TomEE to work with Azure Service Bus?
Thanks!