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 API Support » BEst practice in MQ app

Post new topic  Reply to topic Goto page 1, 2  Next
 BEst practice in MQ app « View previous topic :: View next topic » 
Author Message
jeevan
PostPosted: Fri Feb 10, 2006 10:25 am    Post subject: BEst practice in MQ app Reply with quote

Grand Master

Joined: 12 Nov 2005
Posts: 1432

Is there any website which has best practices in MQ appls.

thanks
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Feb 10, 2006 10:26 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Yes.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
jeevan
PostPosted: Fri Feb 10, 2006 10:30 am    Post subject: Reply with quote

Grand Master

Joined: 12 Nov 2005
Posts: 1432

where ?
can you please give me the link

thanks
Back to top
View user's profile Send private message
ramires
PostPosted: Fri Feb 10, 2006 11:10 am    Post subject: Reply with quote

Knight

Joined: 24 Jun 2001
Posts: 523
Location: Portugal - Lisboa

MQSeries.net it's a great site!
Back to top
View user's profile Send private message
jeevan
PostPosted: Fri Feb 10, 2006 11:26 am    Post subject: Reply with quote

Grand Master

Joined: 12 Nov 2005
Posts: 1432

that fine. Can some one give me some of the best practice in programming for MQ? or MDB?

thanks
Back to top
View user's profile Send private message
mvic
PostPosted: Fri Feb 10, 2006 11:57 am    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

jeevan wrote:
best practice in programming for MQ?

The sample programs available in the MQ installation are intended to show best practices. There are also others availabe here (see "repository") and on developerWorks.

There may also be IBM education classes available (there used to be, anyway).
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Feb 10, 2006 1:28 pm    Post subject: Reply with quote

Grand High Poobah

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

jeevan wrote:
that fine. Can some one give me some of the best practice in programming for MQ? or MDB?

thanks

And talking specifically about MDB there is a great readbook about JMS Topology.

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
hdjur
PostPosted: Thu Nov 16, 2006 11:58 am    Post subject: Reply with quote

Centurion

Joined: 16 Sep 2004
Posts: 116
Location: Zagreb

Can someone give me the best practice for opening the reply queue? As I see it, there are no more than two reasonable ways:
    1. request driven - take ReplyToQ and ReplyToQMgr from request MQMD and provide it as ObjectName and ObjectQMgrName input to MQOD
    2. hard coded ObjectName and blank (default) ObjectQMgrName input to MQOD


Looking at Table 3. Resolving queue names when using MQOPEN: http://publibfp.boulder.ibm.com/epubs/html/csqzal06/csqzal061x.htm#HDROPENOBJ

from application developer point of view is there any other possible choice? I'm talking about establishing standard for writing applications in my company regarding that matter, in order to achieve portable, scalable, etc. applications, so that an MQadmin may introduce new qmgrs, clusters, message brokers etc. with no changes in applications required.
Back to top
View user's profile Send private message
mvic
PostPosted: Thu Nov 16, 2006 12:30 pm    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

hdjur wrote:
from application developer point of view is there any other possible choice?

I know of none. Is there a reason the above two options are not acceptable?
Back to top
View user's profile Send private message
tleichen
PostPosted: Thu Nov 16, 2006 12:34 pm    Post subject: Reply with quote

Yatiri

Joined: 11 Apr 2005
Posts: 663
Location: Center of the USA

hdjur wrote:
Can someone give me the best practice for opening the reply queue? As I see it, there are no more than two reasonable ways:
    1. request driven - take ReplyToQ and ReplyToQMgr from request MQMD and provide it as ObjectName and ObjectQMgrName input to MQOD
    2. hard coded ObjectName and blank (default) ObjectQMgrName input to MQOD


Looking at Table 3. Resolving queue names when using MQOPEN: http://publibfp.boulder.ibm.com/epubs/html/csqzal06/csqzal061x.htm#HDROPENOBJ

from application developer point of view is there any other possible choice? I'm talking about establishing standard for writing applications in my company regarding that matter, in order to achieve portable, scalable, etc. applications, so that an MQadmin may introduce new qmgrs, clusters, message brokers etc. with no changes in applications required.

Well, I've had now issues with method 1 above. What other kind of choice would you be looking for?
_________________
IBM Certified MQSeries Specialist
IBM Certified MQSeries Developer
Back to top
View user's profile Send private message
bruce2359
PostPosted: Thu Nov 16, 2006 5:09 pm    Post subject: Reply with quote

Guest




Hard-coding object names is not a best practice.

An application that puts a request message and expects another application to send a reply needs to have a reply-to-queue.

In a distributed queue manager (network of qmgrs) scenario, the name of the reply-to-queue must be resolved on the requesting qmgr before the message is put to the xmit queue. The replying application takes the reply-to-queue and reply-to-queue-manager from the MD, assumes these to be resolved, and uses them to mqput the reply in the transmission queue whose name equals the reply-to-queue-mnager from the inbound MD. The requesting application does an MQGET with a wait on the reply-to-queue for the reply message. This works.

If I understand your Choice 2 (if you consider this a choice) is to have aQLocal defined by a sysadmin (not a dynamic queue) to be used for the requesting application to receive replies. This works fine for one instance of the requesting app and replying app.

But, what if multiple (many, hundreds, thousands)instances of the requesting program send request messages, and multiple replying applications send replies. Now, multiple requestors must find the appropriate reply from all the replies that have arrived in the pre-defined-reply-to-queue.

I had a sysadmin tell me that Choice 2 is a dramatic processor saving idea given the machine cycles it takes for a dynamic reply queue to be created each time one is needed. While this might seem to be intuitive, this technique creates the programming challenge above.

My rule of thumb is not to write applications around hardware configurations because they change frequently.
Back to top
hdjur
PostPosted: Fri Nov 17, 2006 11:13 am    Post subject: Reply with quote

Centurion

Joined: 16 Sep 2004
Posts: 116
Location: Zagreb

tleichen wrote:
Well, I've had now issues with method 1 above.
Did you mean:
Quote:
Well, I've had no issues with method 1 above.
Consider this. There is a cluster of qmgrs in which requesting appls put requests to clustered queues hosted only by qmgrs local to replying appls, which on the other hand put replies to clustered queues hosted only by qmgrs local to requesting appls. Since there are multiple instances of the same reply queues hosted by multiple qmgrs local to requesting appls (and multiple instances of requesting appls, both requesting and replying appls are MQ server appls holding only a connection to a local qmgr), replying appls use method 1 to reply to a "proper" instance of a reply queue. I'm not sure whether we call it message affinity too, I think so, although, reply consists of only one physical and logical message, there is no groups, no segmentation etc. And method 1 seems to be a natural convention for such an environment. If I want to introduce message broker qmgr in between (message flows are also MQ server appls connected only to a broker qmgr), transparently to both applications, what steps are required from MQadmin side, and from message flow developer side? I will make it a part of the same qmgr cluster, but I see no simple (natural) way to ensure that replying appls put replies back to a broker qmgr hosted queue. I may save ReplyToQMgr from request MQMD in a copy of a request message in a backup queue on broker qmgr, and I may input broker qmgr name instead of original ReplyToQMgr when transforming request message in a compute node in message flow which handles request, and then when I get reply, in a message flow which handles reply, I may match it with a copy of a request (by correl Id) so that I may put reply in a proper instance of a reply queue. Or, is there something simpler? I'm talking about benefits from qmgr cluster technology, benefits from message broker technology, ease of administration, simplicity of application code, ease of transformation from clustered "no broker" to a clustered broker environment etc. Maybe, I may establish standard for writing replying applications using method 2., and copying ReplyToQMgr from request MQMD to a reply MQMD? Which also does not seem to be natural. So I ask which is the best practice for this transformation.

Last edited by hdjur on Sun Nov 19, 2006 3:54 am; edited 2 times in total
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Nov 17, 2006 11:21 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Request/Reply is a design pattern.

I have never seen any documentation of this pattern that specifies that the Reply queue can be hard coded.

That is, there is only option 1 as far as I know.

There are additional design patterns that might allow this kind of thing - for example a Request/Acknowledge + Response pattern, in which the Server sends a synchronous acknowledgement of the request and then later an asychronous Response.

But that's actually usually implemented as a Request/Reply and Fire&Forget, or two Request/Replies.

Request/Reply is a very interesting pattern in a Pub/Sub network (at least I find the notion of a ReplyTo Topic to be an interesting one).
_________________
I am *not* the model of the modern major general.


Last edited by jefflowrey on Fri Nov 17, 2006 11:34 am; edited 1 time in total
Back to top
View user's profile Send private message
hdjur
PostPosted: Fri Nov 17, 2006 11:33 am    Post subject: Reply with quote

Centurion

Joined: 16 Sep 2004
Posts: 116
Location: Zagreb

Thanks Jeff.
Back to top
View user's profile Send private message
hdjur
PostPosted: Sun Nov 19, 2006 1:17 am    Post subject: Reply with quote

Centurion

Joined: 16 Sep 2004
Posts: 116
Location: Zagreb

Talking about best practice and design patterns, in the example above I can avoid backup queue if I choose to have one message flow for handling request, waiting for reply, and handling reply, but I assume it would be a bad choice? Is it better to create two separate message flows, one for handling request, and the other for handling reply, to avoid possible bottlenecks in a message flow? Requesting and replying applications work in synchronous mode.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ API Support » BEst practice in MQ app
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.