I have successfully configured Apache Qpid JMS client (0.41.0) in Open Liberty to send messages to an Azure Service Bus queue.
My server.xml looks like this:
<jndiObjectFactory id="servicebusfactory" libraryRef="qpidlibsid"
className="org.apache.qpid.jms.jndi.JNDIReferenceFactory"
objectClassName="org.apache.qpid.jms.JmsConnectionFactory">
</jndiObjectFactory>
<jndiReferenceEntry id="qpidconnectionfactory"
jndiName="jms/ServiceBus"
factoryRef="servicebusfactory">
<properties remoteURI="amqps://xxx.servicebus.windows.net?amqp.idleTimeout=120000&amqp.traceFrames=true&;jms.username=xxxx&jms.password=xxx"/>
</jndiReferenceEntry>
<jndiObjectFactory id="queuefactory" libraryRef="qpidlibsid"
className="org.apache.qpid.jms.jndi.JNDIReferenceFactory"
objectClassName="org.apache.qpid.jms.JmsQueue">
</jndiObjectFactory>
<jndiReferenceEntry id="myqueue"
jndiName="jms/myqueue"
factoryRef="queuefactory">
<properties address="myqueue" />
</jndiReferenceEntry>
Using the above server config I can send messages without issues to a Service Bus queue (using a JMS message producer).
The problem is receiving messages using a message-driven-bean. I have tried this config:
@MessageDriven(name = "processorMDB", activationConfig = {
@ActivationConfigProperty(propertyName = "destinationLookup", propertyValue = "jms/myqueue"),
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
@ActivationConfigProperty(propertyName = "connectionFactoryLookup", propertyValue = "jms/ServiceBus"),
})
I get a warning when starting Open Liberty:
[WARNING ] CNTR4016W: The message endpoint for the processorMDB message-driven bean cannot be activated because the jms/myqueue destination is not available. The message endpoint will not receive messages until the destination becomes available.
I need some kind of activation spec I assume, but I cannot get it to work correctly.
Help or explanation on how to use the activation spec in Open Liberty is appreciated!