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 » WebSphere Message Broker (ACE) Support » Multiple type messages on same queue

Post new topic  Reply to topic
 Multiple type messages on same queue « View previous topic :: View next topic » 
Author Message
Y75
PostPosted: Tue Aug 27, 2013 12:20 pm    Post subject: Multiple type messages on same queue Reply with quote

Apprentice

Joined: 29 Jul 2013
Posts: 32

I have multiple (undetermined) type of messages arriving on a queue. What is the best way to recognize a message without looking at its contents?

I can use a message property. Is MsgType or Format fields in MQMD good candidates? What is usually used for this type of requirement?

I am new to MQ.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Aug 27, 2013 12:25 pm    Post subject: Re: Multiple type messages on same queue Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Y75 wrote:
I have multiple (undetermined) type of messages arriving on a queue. What is the best way to recognize a message without looking at its contents?


You've posted this in a message broker section. If this is because you're using message broker, what's the problem with looking at the contents? If you're not, do you want this moved to a WMQ section to prevent further confusion?

Y75 wrote:
I can use a message property. Is MsgType or Format fields in MQMD good candidates? What is usually used for this type of requirement?


Message properties are usually used for this. MsgType and Format are not only not good candiates for this (as they can be used internally by the WMQ software) they're not message properties but fields in the MQMD header.

Also - local queues are cheap. If you really have distinct messages as opposed to messages which are just sub-classes of each other, seriously consider having them sent to separate, dedicated queues and working out message type from the queue that they're on. Much easier & cleaner.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Aug 27, 2013 12:43 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

In the old days, people would use the NameValueData part of an MQRFH2 header to set the MRM 'fab four' properties : domain, set, type and format. These days, I guess the same thing could be achieved using MQ message properties.

But I agree with Vitor : queues are cheap. Do you really need to do this?
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
Y75
PostPosted: Tue Aug 27, 2013 12:44 pm    Post subject: Reply with quote

Apprentice

Joined: 29 Jul 2013
Posts: 32

Thanks for the reply!

I am using Message broker.

There is no problem in looking at message contents from feasibility point of view, just the nature of product I am building prevents me from doing so and also, I want to avoid parsing.

I agree using separate queue's is a much cleaner solution and seemingly a best practice ,datatype channel pattern, but one MQInput node can't listen to multiple queue's. I can't have a mutiple MQInput nodes as there can be lots of types of messages. If I could have multiple queue I can control queue depth and other properties based on type of message. Wish I could do that.
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Aug 27, 2013 1:48 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
I can't have a mutiple MQInput nodes as there can be lots of types of messages
The usual solutions to this are:
- have lots of separate flows
- allow some flows to have multiple input nodes
- keep the number of flows to a reasonable number by creating flexible models that can parse N different variants of a data format.

I guess you probably thought of those solutions already, but hopefully this will provoke you into revealing why you need a single, generic gateway flow.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Aug 28, 2013 1:49 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Y75 wrote:
Thanks for the reply!

I am using Message broker.

There is no problem in looking at message contents from feasibility point of view, just the nature of product I am building prevents me from doing so and also, I want to avoid parsing.

I agree using separate queue's is a much cleaner solution and seemingly a best practice ,datatype channel pattern, but one MQInput node can't listen to multiple queue's. I can't have a mutiple MQInput nodes as there can be lots of types of messages. If I could have multiple queue I can control queue depth and other properties based on type of message. Wish I could do that.


The question is, what can you do to ensure the sending applications always do "the right thing" to specify the type of message? If the answer is "nothing", then you have to assume you have to parse the message at least a little bit. If you can do "something", then the easiest thing to do is have the sending application use different queues.

The second question is, what do you do with the message once you figure out what "type" of message it is?

Do you immediately turn around and post it to a separate queue?

Or do you see if you have existing logic to handle it, and then process it in the same or slightly different thread?

Again, this may lead you to using more than one queue.
Back to top
View user's profile Send private message
Y75
PostPosted: Wed Aug 28, 2013 8:35 am    Post subject: Reply with quote

Apprentice

Joined: 29 Jul 2013
Posts: 32

While building this solution, I am assuming I can control sending applications to post message to different queue's and also ask them to set properties i wish. Its more about how my gateway like flow can handle different undetermined queue's.

I am guessing when solution gets customized and deployed at client site, they may want to have different queue's for different messages or some combination of what kimbert suggests.

Code:

The usual solutions to this are:
- have lots of separate flows
- allow some flows to have multiple input nodes
- keep the number of flows to a reasonable number by creating flexible models that can parse N different variants of a data format.


Probably I should built all of my flow as subflow and let clients put in input nodes in a new message flow that includes my subflow if they desire. I can ship the solution with one message flow with one input node. Haven't thought this through yet.

Code:


The second question is, what do you do with the message once you figure out what "type" of message it is?


I read "processing profile" for a function and figure out what systems to call and what transformations to run and call them. That's all I can tell. [/code]
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Aug 28, 2013 8:50 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Y75 wrote:
While building this solution, I am assuming I can control sending applications to post message to different queue's and also ask them to set properties i wish.


The abilty to control application developers is a heck of an assumption...
_________________
Honesty is the best policy.
Insanity is the best defence.
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 » WebSphere Message Broker (ACE) Support » Multiple type messages on same queue
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.