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 » best synchronous method

Post new topic  Reply to topic
 best synchronous method « View previous topic :: View next topic » 
Author Message
tricky_knight
PostPosted: Thu Mar 17, 2005 5:18 pm    Post subject: best synchronous method Reply with quote

Apprentice

Joined: 12 Mar 2005
Posts: 34

hello folks,

Although it is against the grain to try to implement JavaMQ/jms in a synchronous way, I was wondering what it the predominate method?

I would assume that you would use correllation ID?

for example,
you could put a message on a remoteqDef queue using a stateless session bean and receive the message back using an MDB.? (correlID/message filtering?)



thanks for any input
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Mar 17, 2005 6:43 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

An MDB with filter is not a good idea for the request response scenario.
You are better off with a receiver with time out and a filter.

On top of it you should really be using a temporary queue as a replyto JMS Destination. Makes sure that nobody else gets the message.

Enjoy
Back to top
View user's profile Send private message Send e-mail
JLRowe
PostPosted: Fri Mar 18, 2005 5:37 am    Post subject: Reply with quote

Yatiri

Joined: 25 May 2002
Posts: 664
Location: South East London

WAS server foundation has the extended messaging feature, it can generate sender and receiver beans that handle the complexity of correlating the request and reply together.

http://www-106.ibm.com/developerworks/websphere/techjournal/0401_green/green.html
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Fri Mar 18, 2005 10:21 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Sure but you will notice that in the apps design in the provided link the sender bean is responsible for getting the response in the request response model.

We are talking here about a slightly different scenario:
It makes no sense to create a receiver bean to be responsible for the response because the lifetime of the bean would be only one message or series of messages.

On top of it the performance hit for an MDB with a selector is prohibitive as soon as you have more than one on the same queue.

It is much better to use an MDB with no selectors and to distribute to different "client" queues. One per recipient. Each of the recipients can then have its own MessageListener on the queue.

Like I said for a request response model I would create my own temporary response queue, put it into the JMSReplyTo and do a receive with timeout on the queue.

Enjoy
Back to top
View user's profile Send private message Send e-mail
tricky_knight
PostPosted: Fri Mar 18, 2005 7:33 pm    Post subject: Reply with quote

Apprentice

Joined: 12 Mar 2005
Posts: 34

Quote:

Like I said for a request response model I would create my own temporary response queue, put it into the JMSReplyTo and do a receive with timeout on the queue.


So FJB, you are basically saying to use the JMS, QueueRequester. I read some on that today and it looks like it may do the trick. I could use this QueueRequester in a StatelessSession bean correct? So I can just have another pojo in the j2ee system lookup this sessionbean to send req/reply with this QueueRequestor using the temporary queue it prroduces. By the way the messages I am sending will be non-persistent.

Sound correct?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Mar 18, 2005 11:51 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Sounds correct. However I was speaking about a queue receiver:
javax.jms.QueueReceiver and not requester ??

Use the receiver with a filter no problem. When you have received the message close the receiver and let it be garbage collected.

Enjoy
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 » IBM MQ Java / JMS » best synchronous method
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.