ikos23
ikos23

Reputation: 5354

open-liberty : cannot configure jmsActivationSpec

I have the following configs in my IBM Liberty server.xml:

<!-- resource adapter location -->
<variable name="wmqJmsClient.rar.location" value="${shared.resource.dir}/lib/global/wmq.jmsra-9.1.0.0.rar"/>

<!-- jmsActivationSpec configs -->
<jmsActivationSpec authDataRef="myAuthData" id="my-app-name/MyMessageDrivenBean">
        <properties.wmqJms destinationRef="jms/MyQueue"
                           destinationType="javax.jms.Queue"
                           sslCipherSuite="SSL_RSA_WITH_AES_256_CBC_SHA256"
                           channel="MY.MQCHANNEL"
                           queueManager="MY_QM"
                           hostName="myhost" port="32100"
                           transportType="CLIENT" />
</jmsActivationSpec>

I also have a message-driven bean I am using to handle messages that appear on the queue. And everything works fine.

I'd like to migrate to open-liberty and keep my JMS stuff but their documentation is a little bit different even though the same config elements are there.

Some properties are missing and it's not clear how to replace them. No hostName and port, instead I found only remoteServerAddress and it has to be a triplet host:port:something_i_dont_understand so not sure it's exactly the same :)

How can I configure all this required stuff in open-liberty to make my message-driven bean work?

Any help is appreciated :)

Upvotes: 0

Views: 1346

Answers (1)

Alasdair
Alasdair

Reputation: 3176

In WebSphere Liberty you are likely using the wmqJmsClient-2.0 feature. This isn't available in Open Liberty, but it is really only a convenience feature. You should be able to configure the following:

<featureManager>
    <feature>jms-2.0</feature>
    <feature>jca-1.7</feature>
</featureManager>

<resourceAdapter id="mqJMS" location="${shared.resource.dir}/lib/global/wmq.jmsra-9.1.0.0.rar"/>

<!-- jmsActivationSpec configs -->
<jmsActivationSpec authDataRef="myAuthData" id="my-app-name/MyMessageDrivenBean">
    <properties.mqJms destinationRef="jms/MyQueue"
                      destinationType="javax.jms.Queue"
                      sslCipherSuite="SSL_RSA_WITH_AES_256_CBC_SHA256"
                      channel="MY.MQCHANNEL"
                      queueManager="MY_QM"
                      hostName="myhost" port="32100"
                      transportType="CLIENT" />
</jmsActivationSpec>

This configures the jms-2.0 feature, and the jca-1.7 which enables the JMS, and RA support in Liberty. The resourceAdapter element configures Liberty to know about the RA's existence and where it is (similar to the variable you have in your existing configuration). The value of the id attribute is then used on the properties element under the jmsActivationSpec element, so in the wmqJmsClient-2.0 feature we define this to be wmqJms, in this case I've used mqJms because I think wmqJms is reserved. In any case this config should work both in Open Liberty and WebSphere Liberty.

Upvotes: 4

Related Questions