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 » General IBM MQ Support » Fetching Queue Name

Post new topic  Reply to topic
 Fetching Queue Name « View previous topic :: View next topic » 
Author Message
mandy13
PostPosted: Mon Sep 23, 2013 2:59 am    Post subject: Fetching Queue Name Reply with quote

Apprentice

Joined: 17 Apr 2013
Posts: 28

Hi,

I have a program which reads data from 5 different queues. I have 1 listener which listenes to all the queues for messages.

When I receive a messgage from any 1 of the 5 queues using MQGET, is it possible to know from which queue the message has arrived?

I checked REPLYTOQ field in message descriptor, but it was blank.


Thanks,
Mandar
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Mon Sep 23, 2013 3:04 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

When you issued the MQGET, you used an Object Handle as one of the parameters of the MQGET call.

You got that Object Handle when you did a successful MQOPEN on the queue. When you issued the MQOPEN, you supplied the queue name.

Keep track of which Object Handles go with which Queue Names.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
mandy13
PostPosted: Mon Sep 23, 2013 3:25 am    Post subject: Reply with quote

Apprentice

Joined: 17 Apr 2013
Posts: 28

"We need to get the queue name from the message" - so is there any way that we can get from the message
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Sep 23, 2013 3:46 am    Post subject: Reply with quote

Grand High Poobah

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

mandy13 wrote:
"We need to get the queue name from the message"


Why? What's the requirement?

mandy13 wrote:
is there any way that we can get from the message


No.

How would the message know what queue it was in, given the number of queues it can traverse going from one queue manager to another?

Why would IBM build such a feature, given that any application reading a message from a queue must explicitly know which queue it came from to be able to read it?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mandy13
PostPosted: Mon Sep 23, 2013 5:51 am    Post subject: Reply with quote

Apprentice

Joined: 17 Apr 2013
Posts: 28

Thanks Vitor for your reply

I am reading from several queues using MQCB and depending upon the queue from which the message comes from i need to send it to different applications.

I need the queue name so that i can categorize the message and send it to the appropriate application.

Thanks,
Mandy
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Sep 23, 2013 6:09 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Use the context.
Back to top
View user's profile Send private message
PaulClarke
PostPosted: Mon Sep 23, 2013 6:13 am    Post subject: Reply with quote

Grand Master

Joined: 17 Nov 2005
Posts: 1002
Location: New Zealand

If you are using MQCB then you should look at the Callback Context structure (MQCBC) to see why you have been called. In that structure is the handle (MQHOBJ) which has been used to retrieve the message. Assuming you have kept a list of the handles that you opened you can easily determine which queue the message was got from.

Cheers,
Paul.
_________________
Paul Clarke
MQGem Software
www.mqgem.com
Back to top
View user's profile Send private message Visit poster's website
wmbwmq
PostPosted: Mon Sep 23, 2013 10:05 am    Post subject: Reply with quote

Acolyte

Joined: 18 Jul 2011
Posts: 66

Quote:

How would the message know what queue it was in, given the number of queues it can traverse going from one queue manager to another?


Why not? if the MQMD can contain replytoQ and replytoQMGR why do you think sourceQueue is something impossible?, well just that IBM didn't include it unfortunately. Btw, Message Broker populates the source queue right into the MQMD header (that is by default).

Quote:

Why would IBM build such a feature, given that any application reading a message from a queue must explicitly know which queue it came from to be able to read it?


I am so sorry but I personally dislike someone commenting on someones's design. We are not in his shoes nor what kind design restrictions they are facing in this global + frequent company takeover/merging kind of scenarios...so...
Back to top
View user's profile Send private message
mandy13
PostPosted: Thu Sep 26, 2013 1:46 am    Post subject: Reply with quote

Apprentice

Joined: 17 Apr 2013
Posts: 28

Thanks Paul and wmbwmq for your suggestions.
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 » General IBM MQ Support » Fetching Queue Name
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.