ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General Discussion » Many WebSphere MQ queues, one JMS definition?

Post new topic  Reply to topic
 Many WebSphere MQ queues, one JMS definition? « View previous topic :: View next topic » 
Author Message
camauz
PostPosted: Fri Jan 09, 2009 2:26 am    Post subject: Many WebSphere MQ queues, one JMS definition? Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Sat Jan 10, 2009 4:15 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Sat Jan 10, 2009 6:02 am    Post subject: Reply with quote

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
View user's profile Send private message
camauz
PostPosted: Sat Jan 10, 2009 8:59 am    Post subject: Reply with quote

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
View user's profile Send private message
camauz
PostPosted: Sat Jan 10, 2009 9:08 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Sat Jan 10, 2009 10:36 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
camauz
PostPosted: Mon Jan 12, 2009 6:55 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Mon Jan 12, 2009 3:32 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » Many WebSphere MQ queues, one JMS definition?
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.