Author |
Message
|
dilep |
Posted: Tue Oct 26, 2010 7:50 pm Post subject: Two listeners in a single queue |
|
|
Apprentice
Joined: 27 Nov 2006 Posts: 40
|
Hi,
Is two listeners (different Websphere Java application, putting message by one application getting message by another application) is possible to a single queue.
Thanks & Regards |
|
Back to top |
|
 |
zpat |
Posted: Tue Oct 26, 2010 10:03 pm Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Yes, you can have as many putters and getters running at the same time as you want (within reason) - all using the same queue (or set of queues).
MQ is transactionally safe for concurrent access. |
|
Back to top |
|
 |
aditya.aggarwal |
Posted: Wed Oct 27, 2010 6:16 am Post subject: |
|
|
 Master
Joined: 13 Jan 2009 Posts: 252
|
Quote: |
Yes, you can have as many putters and getters running at the same time as you want (within reason) - all using the same queue (or set of queues).
MQ is transactionally safe for concurrent access. |
but if it is One Put application and Two get applications then Application code need to modified for issuing correct get call for correct message.. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Oct 27, 2010 6:35 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
aditya.aggarwal wrote: |
but if it is One Put application and Two get applications then Application code need to modified for issuing correct get call for correct message.. |
Unless the get application doesn't care which message it gets, and there are n get applications solely because the put application processes n times faster than the get. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
aditya.aggarwal |
Posted: Wed Oct 27, 2010 6:43 am Post subject: |
|
|
 Master
Joined: 13 Jan 2009 Posts: 252
|
Quote: |
Unless the get application doesn't care which message it gets, and there are n get applications solely because the put application processes n times faster than the get. |
 |
|
Back to top |
|
 |
shashivarungupta |
Posted: Fri Oct 29, 2010 7:31 pm Post subject: |
|
|
 Grand Master
Joined: 24 Feb 2009 Posts: 1343 Location: Floating in space on a round rock.
|
Vitor wrote: |
aditya.aggarwal wrote: |
but if it is One Put application and Two get applications then Application code need to modified for issuing correct get call for correct message.. |
Unless the get application doesn't care which message it gets... |
dilep: Hope you understand this point !
The get applications have such criteria that they can identify what they should get and what they should reject ? (Only if they are concerned about it)  _________________ *Life will beat you down, you need to decide to fight back or leave it. |
|
Back to top |
|
 |
zpat |
Posted: Fri Dec 10, 2010 3:43 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
If you want messages processed differently in some way use two queues.
If you want messages processed in the same way but in parallel use one queue and two (or more) getters. Each getter simply takes the next available message.
It's not just about matching put and get speed. It might be used for reasons of latency, and most importantly resilience - since if one getter fails then the other(s) can just carry on.
Using get with syncpoint will even protect a message against failure during processing by one getter and return it to the queue so that another getter can deal with it.
All in all a very useful, flexible and scaleable option to use. |
|
Back to top |
|
 |
bruce2359 |
Posted: Fri Dec 10, 2010 5:45 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
another caveat: if individual messages are related to each other (message affinity), then one of the multiple concurrent getters might consume a message belonging to another getter. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
zpat |
Posted: Fri Dec 10, 2010 7:15 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
In that case message grouping could be used, but the model is more suitable to atomic transactions at higher volumes.
You can't guarentee to have a single getter unless the queue is set to open with input exclusive rather than shared. |
|
Back to top |
|
 |
|