Author |
Message
|
cplin |
Posted: Thu Apr 28, 2011 11:04 am Post subject: Request-Response using MQ JMS API |
|
|
Newbie
Joined: 28 Apr 2011 Posts: 3
|
I need to select messages that match a specific correlation id and it would appear the only way to do that is to create a new MQQueueReceiver and specify the new JMS selector string. Is this true or is there a more efficient way? It looks like I lose approximately 20 milliseconds on the construction and I'm hoping to optimize this. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Apr 28, 2011 11:38 am Post subject: Re: Request-Response using MQ JMS API |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
cplin wrote: |
I need to select messages that match a specific correlation id and it would appear the only way to do that is to create a new MQQueueReceiver and specify the new JMS selector string. Is this true or is there a more efficient way? It looks like I lose approximately 20 milliseconds on the construction and I'm hoping to optimize this. |
You mean to say that your request is being processed and returned in less than 20 ms??  _________________ MQ & Broker admin |
|
Back to top |
|
 |
cplin |
Posted: Thu Apr 28, 2011 11:58 am Post subject: |
|
|
Newbie
Joined: 28 Apr 2011 Posts: 3
|
I mean to say that I'm losing 20ms on the creation of the MQQueueReceiver. If there was a way for me to create that once and re-use, I could save myself 20ms. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Apr 28, 2011 12:04 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
cplin wrote: |
I mean to say that I'm losing 20ms on the creation of the MQQueueReceiver. If there was a way for me to create that once and re-use, I could save myself 20ms. |
There is no saving of 20 ms on the thread if the application needs more than 20 ms to process the response and dispatch.
This is why the application is multi-threaded. If you need those 20 ms you may need to implement an asynchronous pattern and consume the messages without selector...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
cplin |
Posted: Thu Apr 28, 2011 12:09 pm Post subject: |
|
|
Newbie
Joined: 28 Apr 2011 Posts: 3
|
Okay, I just wanted to confirm. I was curious whether there was another approach such as dynamically changing the selector on the MQQueueReceiver. However, I've read that approach doesn't work. I wonder if using the MQ Java classes approach instead of the JMS API approach would yield better performance (testing now). Thanks. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Apr 29, 2011 11:26 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
If you want to do this without using a selector, use a temporary queue up front.
Then, at least, you won't lose time waiting on the response - you will have used up maybe extra time before you sent the request, but... |
|
Back to top |
|
 |
|