Author |
Message
|
camauz |
Posted: Fri Jan 09, 2009 2:26 am Post subject: Many WebSphere MQ queues, one JMS definition? |
|
|
 Acolyte
Joined: 20 Aug 2007 Posts: 52 Location: Mojan, Italy
|
Dear all,
I'm looking for precious suggestions to solve this problem.
There is a legacy application, an application cannot be changed; it consumes messages from hundreds of queues: there are hundreds of processes, every process consumes messages from one queue.
There will be a new application, an application will be developed from scratch: it will be a J2EE application running inside WebSphere Application Server, and it should use JMS instead of MQ Java base API.
I would avoid to create hundreds of JMS definitions inside WAS to map all the WebSphere MQ queues: is there a way to create a "generic" JMS definition and leave the application to specify the desired MQ queue?
Is there a smart solution to this problem? (Unfortunately I do not have WebSphere Message Broker: it would help me with dynamic routing).
Thanks in advance
Regards
Camauz |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Jan 10, 2009 4:15 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
If you are using MDB's you will have to use a specific JNDI setup for each queue.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqjeff |
Posted: Sat Jan 10, 2009 6:02 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
What is the business value provided by separate queues? What is the technical value?
Where can a QALIAS help? |
|
Back to top |
|
 |
camauz |
Posted: Sat Jan 10, 2009 8:59 am Post subject: |
|
|
 Acolyte
Joined: 20 Aug 2007 Posts: 52 Location: Mojan, Italy
|
mqjeff wrote: |
What is the business value provided by separate queues? What is the technical value?
Where can a QALIAS help? |
It's the result of a server consolidation with "0 modification policy" on the application. It's legacy, it cannot be changed and must stay there. |
|
Back to top |
|
 |
camauz |
Posted: Sat Jan 10, 2009 9:08 am Post subject: |
|
|
 Acolyte
Joined: 20 Aug 2007 Posts: 52 Location: Mojan, Italy
|
fjb_saper wrote: |
If you are using MDB's you will have to use a specific JNDI setup for each queue.  |
The new application does not have to consume messages because it's a producer: every J2EE transaction must put a message in a queue; the target queue is a queue in a set of several hundreds; the destination is coded in the message payload too. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Jan 10, 2009 10:36 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
camauz wrote: |
fjb_saper wrote: |
If you are using MDB's you will have to use a specific JNDI setup for each queue.  |
The new application does not have to consume messages because it's a producer: every J2EE transaction must put a message in a queue; the target queue is a queue in a set of several hundreds; the destination is coded in the message payload too. |
As a producer, how do you define the Destination
- Retrieve from JNDI
- create from session using Session.createQueue(basename);
- create from session using Session.createQueue(uri);
- retrieve from properties and using one of the create from Session
Looking at a consolidation the easiest is changing the JNDI to all point to the same physical queue. No change to the app.
All other changes involve creating the Alias queues so that the queue exists physically on MQ as it is a target Destination in JMS...
As a consumer you can use the same approach. Remember however that you can only consume from a queue that is defined as a queue local to the qmgr you are connected to, and that to consume as an MDB you will need to have the configuration including JNDI pointing to the queue that you are consuming from.
Let's look at consuming from a single queue instead of a hundred queues. You do not need to change the application if you can do the following: have a dispatcher MDB that calls the respective onMessage method of the appropriate processing MDB and remember about resetting the reading position on the message if you had to access it for dispatching purposes... You might have to change the descriptors somewhat though: transaction handling... and think about comprehensive error handling on the single consumer/dispatcher MDB....
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
camauz |
Posted: Mon Jan 12, 2009 6:55 am Post subject: |
|
|
 Acolyte
Joined: 20 Aug 2007 Posts: 52 Location: Mojan, Italy
|
fjb_saper wrote: |
[...]
As a producer, how do you define the Destination
- Retrieve from JNDI
- create from session using Session.createQueue(basename);
- create from session using Session.createQueue(uri);
- retrieve from properties and using one of the create from Session
[...]
|
I'm checking what I'm understanding:
"Retrieve from JNDI"
if the new application must retrieve from JNDI all the specs of the queue, I need hundres of JNDI entries to manage hundreds of WebSphere MQ queues. Our JNDI registry in WAS, so I need hundreds of definitions in WAS console.
"create from session using Session.createQueue"
I can use only one JNDI spec for a generic queue, for example with a dummy name, ad use setBaseQueueName to specify the real WebSphere MQ base queue name.
Am I right?
Thanks
Regards |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Jan 12, 2009 3:32 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
camauz wrote: |
I'm checking what I'm understanding:
"Retrieve from JNDI"
if the new application must retrieve from JNDI all the specs of the queue, I need hundres of JNDI entries to manage hundreds of WebSphere MQ queues. Our JNDI registry in WAS, so I need hundreds of definitions in WAS console. |
Not quite. You could use a jacl script to create the JNDI setup...
camauz wrote: |
"create from session using Session.createQueue"
I can use only one JNDI spec for a generic queue, for example with a dummy name, ad use setBaseQueueName to specify the real WebSphere MQ base queue name.
Am I right?
Thanks
Regards |
I thought you were not allowed to change any of the application code...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|