Author |
Message
|
er_pankajgupta84 |
Posted: Fri Dec 09, 2011 2:48 pm Post subject: Alias Queue question |
|
|
 Master
Joined: 14 Nov 2008 Posts: 203 Location: charlotte,NC, USA
|
Suppose there 10 systems who are putting data to a Queue and i want to identify which message comes from which system without looking into the contents of message then.
One way of doing so is to have them put the message to separate Queue and then do a table lookup for Q->system.
I can't add 10 physical Queues as the number of system might grow from 10 to 20 (needing same transformation) and don't want to do a re-deployment whenever a system is added.
so i thought of creating 10 alias Queues and 1 physical Queue for them
But when the message comes to broker thru alias Q.. the src_q in MQMD header has the actual Queue name and not the alias Q name.
So is there a way where we can get the alias Q name in MQMD instead of the actual Q name.
Is ther any other way of fulfiling this required without looking at the content of message and without using any custom header. |
|
Back to top |
|
 |
inMo |
Posted: Fri Dec 09, 2011 5:19 pm Post subject: |
|
|
 Master
Joined: 27 Jun 2009 Posts: 216 Location: NY
|
The alias q name will show if you issue the get against it. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Dec 09, 2011 5:57 pm Post subject: Re: Alias Queue question |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
er_pankajgupta84 wrote: |
I can't add 10 physical Queues as the number of system might grow from 10 to 20 (needing same transformation) and don't want to do a re-deployment whenever a system is added.
so i thought of creating 10 alias Queues and 1 physical Queue for them |
So if the broker is reading from the alias queues, how are you going to get round redeploying the flow with 10 more input nodes for the 10 new alias queues? Unless WMB is reading from the physical queue in which case:
er_pankajgupta84 wrote: |
But when the message comes to broker thru alias Q.. the src_q in MQMD header has the actual Queue name and not the alias Q name. |
Do you mean it came to broker thru an alias queue in that it was put through an alias queue onto the local queue broker was reading from? Because in that instance, broker doesn't know anything about how the message arrived on the queue any more than any WMQ application would know that.
er_pankajgupta84 wrote: |
So is there a way where we can get the alias Q name in MQMD instead of the actual Q name. |
The SourceQueue in the MQMD part of the WMB message tree is the name of the queue the message was read from. If broker is reading from a local queue, it's the local queue name. If broker is reading from an alias queue it's the alias queue name. Nothing in WMB or WMQ records if a message arrived on queue by a given route.
er_pankajgupta84 wrote: |
Is ther any other way of fulfiling this required without looking at the content of message and without using any custom header. |
No. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
er_pankajgupta84 |
Posted: Fri Dec 09, 2011 7:12 pm Post subject: |
|
|
 Master
Joined: 14 Nov 2008 Posts: 203 Location: charlotte,NC, USA
|
Hmmm..
I wish there could be some way.
Adding physical queue is not an option.
Adding any header is not allowed
Reading content of message and then decide - dont want to do.
See if someone can suggest a workaround. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Fri Dec 09, 2011 8:10 pm Post subject: Re: Alias Queue question |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
er_pankajgupta84 wrote: |
without using any custom header. |
The MQMD is not a custom header, its the standard one. If the sending apps were willing to change to put to unique Alias queue names, they would be willing to change one line of code to set an appropriate field in the MQMD to indicate the system they are coming from?
Or,
If the 10 different "systems" are connected to 10 different QMs, then just look at the Reply To Queue Manager field in the MQMD. Although this is no guarantee of uniqueness if 2 or more systems can share the same sending Queue Manager. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
Vitor |
Posted: Sat Dec 10, 2011 5:22 am Post subject: Re: Alias Queue question |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
PeterPotkay wrote: |
The MQMD is not a custom header, its the standard one. |
I think the OP is talking in terms of adding an RFH2 (or message properties in these enlightened days).
PeterPotkay wrote: |
If the sending apps were willing to change to put to unique Alias queue names, they would be willing to change one line of code to set an appropriate field in the MQMD to indicate the system they are coming from? |
I suspect the issue is many applications don't set queue names so using alias would only need a JNDI or other non-code change.
However, I do feel a 1 line change to set a field is not unreasonable. Given that the OP wants to identify the source of the message & there's an MQMD field called ApplOriginData! _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
er_pankajgupta84 |
Posted: Sat Dec 10, 2011 9:25 am Post subject: |
|
|
 Master
Joined: 14 Nov 2008 Posts: 203 Location: charlotte,NC, USA
|
MQRFH2 is not an option.
But setting something in MQMD could be possible. I will try this option and post my results.
ReplyTo section cannot be used as we are using it to send a reply back to the other queue of client system.
What would be the best field to put data in MQMD.
ApplOriginData or any other -?
If the source system set alias Queue name in SourceQueue field then wouldn't it get overwritten once I do MQget from the Actual Queue? |
|
Back to top |
|
 |
mqjeff |
Posted: Sat Dec 10, 2011 10:54 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
If you can change the source program to set a field in the MQMD, you can change the source program to set a message property. |
|
Back to top |
|
 |
Vitor |
Posted: Sun Dec 11, 2011 6:51 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
er_pankajgupta84 wrote: |
What would be the best field to put data in MQMD.
ApplOriginData or any other -? |
Well I suggested that and not because I thought it was a stupid place.
er_pankajgupta84 wrote: |
If the source system set alias Queue name in SourceQueue field then wouldn't it get overwritten once I do MQget from the Actual Queue? |
If you find a way for the source system to set the MQMD's SourceQueue field be sure to post it!
A few seconds researching the MQMD will not only reveal which fields are available for your use, and that the SourceQueue field is not in the MQMD for the source system to use.
And before you say "but when I debug / trace the flow I see it in the MQMD" I know that. I leave this paradox as an exercise for the reader, but as a hint look in the WMB documentation not the WMQ. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Dec 11, 2011 9:32 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
This looks to me like a design flaw:
- This is a fire and forget type and the processing app needs to know about the data origin => this should be catered in the message payload.
- This is a request reply type and the question is moot as the response is in the reply to information. The original app does add this to the request. The broker can add it to the payload if needed. If the reply to information is anonymous, and specifics are needed by the processing app, they would still need to be added to the payload by the requesting app.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|