0

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?

Christian
  • 22,585
  • 9
  • 80
  • 106

1 Answers1

1

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.

Community
  • 1
  • 1
Nicholas
  • 15,916
  • 4
  • 42
  • 66
  • Many thanks for your answer. But I have one more question. As I said I have to edit the property via code. How can I change the properties when the wmq already has been deployed. – Christian Sep 11 '14 at 00:11
  • So when a message was sent, I'd like to take that message and set the properties of the wmq rar for example with setProperties("key", "value") or something like that. – Christian Sep 11 '14 at 06:08