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 » IBM MQ Java / JMS » Request-Response using MQ JMS API

Post new topic  Reply to topic
 Request-Response using MQ JMS API « View previous topic :: View next topic » 
Author Message
cplin
PostPosted: Thu Apr 28, 2011 11:04 am    Post subject: Request-Response using MQ JMS API Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Thu Apr 28, 2011 11:38 am    Post subject: Re: Request-Response using MQ JMS API Reply with quote

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
View user's profile Send private message Send e-mail
cplin
PostPosted: Thu Apr 28, 2011 11:58 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Thu Apr 28, 2011 12:04 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
cplin
PostPosted: Thu Apr 28, 2011 12:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Fri Apr 29, 2011 11:26 am    Post subject: Reply with quote

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

MQSeries.net Forum Index » IBM MQ Java / JMS » Request-Response using MQ JMS API
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.