Christian
Christian

Reputation: 22343

set hostname etc. from Websphere MQ Resource Adapter dynamically

I'm currently struggling with the Websphere Resource Adapter for MQ JMS on the JBoss AS 7.1. The adapter itself works great, but I should be able to set some properties dynamically. For example hostName etc.

Currently I have to set the hostName, port etc. for the mq-connection "hard-coded" with a property-file.

For example: mq.hostname = localhost:1421.

Now my question. Is it possible to set this via coding? The problem is that I can't edit the MQ Adapter from IBM because of the copyright and the non-available source-files.

My first idea was, to add a second resource adapter which gets called first and which sets the property of the IBM MQ adapter. Is that possible?

Upvotes: 0

Views: 509

Answers (1)

Nicholas
Nicholas

Reputation: 16056

Your first idea will work. It took me a while to figure it out, but the procedure is outlined in my answer to my question How can I hot deploy a resource-adapter activation in JBoss 7?

Basically, you will deploy the WMQ RAR (wmq.jmsra.rar) as is. Then you deploy a configuration only RAR which contains the ra.xml from the wmq.jmsra.rar archive and an ironjacamar.xml (both in the META-INF sub-folder).

You can find the details in the link. The official way to do this, though, is to follow the procedure outlines in the 2nd link above. I avoided this because I wanted a full WMQ RAR deployment and configuration to be deployed into a vanilla AS7 server, and the official procedure requires editing a few internal configuration files in the AS7 install.

Here's an example WMQ ironjacamar.xml deployment descriptor.

Upvotes: 1

Related Questions