Author |
Message
|
aravind703 |
Posted: Wed May 02, 2012 8:36 am Post subject: Process message from Q and hold a copy of the message in Q |
|
|
Apprentice
Joined: 24 Sep 2011 Posts: 29
|
I have a dumb question, an application (in system A) drops messages to a output queue(TEST_Q1) in system B.
Is there a way I can process the message from TEST_Q1 (in a new flow) and hold a copy of the message in TEST_Q1 . I know that MQ Input node clears the message when it passes the message to the next node.
I need to read the contents of the message but there should be a copy present in the TEST_Q1. |
|
Back to top |
|
 |
zpat |
Posted: Wed May 02, 2012 9:03 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Why do you want a copy on the same queue - as it's asking for trouble?
What are you trying to achieve? |
|
Back to top |
|
 |
mqjeff |
Posted: Wed May 02, 2012 9:04 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
aravind703 |
Posted: Wed May 02, 2012 9:15 am Post subject: @zpat |
|
|
Apprentice
Joined: 24 Sep 2011 Posts: 29
|
Hai Zpat
As soon as the application drops the message in the Queue, broker should pull some details from the message and send an email alert with the details in the body of the message. If this is to be automated, the message still needs to be in the queue for someone to review it.
I thought about shell scripting but was not sure if I can accomplish this using shell script . I am wondering if there is a way in broker. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed May 02, 2012 9:21 am Post subject: Re: @zpat |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
aravind703 wrote: |
As soon as the application drops the message in the Queue, broker should pull some details from the message and send an email alert with the details in the body of the message. If this is to be automated, the message still needs to be in the queue for someone to review it. |
If you replace the words "the queue" with "a queue", does it not still work?
That is, if you read from Queue 1, send the email, and then write to Queue 2, is not the message still available for review?
Also, shouldn't you put the data into a database where it can be read by a web application, instead of forcing people to use queue browsers to view the data? |
|
Back to top |
|
 |
aravind703 |
Posted: Wed May 02, 2012 9:36 am Post subject: @ mqjeff |
|
|
Apprentice
Joined: 24 Sep 2011 Posts: 29
|
Hai mqjeff
I am a great fan of yours, I had read many posts of yours in this forum and have gathered useful information from your posts. Thank you for all the effort your putting to help others like me.
Let me put you my issue here clearly
We have 3 applications,
Application 1 drops in TEST_Q1
Application 2 drops in TEST_Q2
Application 3 drops in TEST_Q3
I am writing a new flow that will read the messages from these three queues (at the input) with 1 compute node and Email output node and then I have to use 3 output queue’s after the compute node in order to save the message of those three queues separately.
This is for initial testing so I am using queue browsers to view the data for my testing. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed May 02, 2012 9:49 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
so you have three queue aliases, and two qlocals (one in, one out). |
|
Back to top |
|
 |
aravind703 |
Posted: Wed May 02, 2012 10:22 am Post subject: @mqjeff |
|
|
Apprentice
Joined: 24 Sep 2011 Posts: 29
|
I don’t have any Alias queues,
all the 3 applications drop messages to their Remote queues RQ1, RQ2 and RQ3( SYSTEM -A ) , these messages are directed to the local queues TEST_Q1, TEST_Q2 & TEST_Q3 ( SYSTEM -B ) a single compute node will process the messages from these 3 local queues. An Email output node is connected to the Compute node which will send email alerts by pulling some details from the message.
Now,
Out1 of compute node Connected to TEST_Q1_NEW ,
Out2 of compute node Connected to TEST_Q2_NEW and
Out3 of compute node Connected to TEST_Q3_NEW ,
This is working currently, but was thinking if I can find a better way to do this. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed May 02, 2012 10:24 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You don't need three queues on the input side.
You need three qremotes, but they don't have to point to three qlocals.
You can have one qlocal.
You can also look at the Browse options on the MQInput node. It requires some additional programming effort, however, to make sure you know when to BROWSE_FIRST again. |
|
Back to top |
|
 |
zpat |
Posted: Wed May 02, 2012 10:32 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Browing is a relatively advanced subject and you need to understand what a browse cursor is.
Consider how you will avoid browsing the same message more than once.
Consider what happens if the execution group, flow or broker is stopped and started again.
etc... |
|
Back to top |
|
 |
aravind703 |
Posted: Wed May 02, 2012 10:56 am Post subject: @mqjeff & zpat |
|
|
Apprentice
Joined: 24 Sep 2011 Posts: 29
|
Thank You very much for the info. I am really interested in looking at the BROWSE options of the MQ input Node
I will be using the queue name (InputRoot.MQMD.SourceQueue) from the incoming message for this reason I was thinking to use 3 local queues(that will be the same name as that of the remote queue in System A). In the email alert I will be using the name of the queue which had a failure message. If I use one LOCAL Queue as input can I find the name of the FAILURE queue.
@ zpat i would love to give a try then take it from there |
|
Back to top |
|
 |
aravind703 |
Posted: Wed May 02, 2012 11:46 am Post subject: @mqjeff |
|
|
Apprentice
Joined: 24 Sep 2011 Posts: 29
|
the MQ input node browse option works for me thank you very much for the information |
|
Back to top |
|
 |
aravind703 |
Posted: Wed May 02, 2012 11:54 am Post subject: @mqjeff |
|
|
Apprentice
Joined: 24 Sep 2011 Posts: 29
|
Quote: |
Hi mqjeff
I will be using the queue name (InputRoot.MQMD.SourceQueue) from the incoming message for this reason I was thinking to use 3 local queues(that will be the same name as that of the remote queue in System A). In the email alert I will be using the name of the queue which had a failure message. If I use one LOCAL Queue as input can I find the name of the FAILURE queue |
|
|
Back to top |
|
 |
mqjeff |
Posted: Wed May 02, 2012 11:57 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
It's a better idea to ensure that all necessary identifying information is available in the contents of the error message, rather than relying on transport level details to provide indicators.
In general, if you have multiple qremotes pointing to the same qlocal, you won't be able to identify which qremote the sending application used.
The big problem with your setup is that it doesn't scale very well. If you have 100 applications, now you need 100 qlocals, 100 qremotes, and 100 MQInput nodes. |
|
Back to top |
|
 |
aravind703 |
Posted: Wed May 02, 2012 12:24 pm Post subject: @ mqjeff |
|
|
Apprentice
Joined: 24 Sep 2011 Posts: 29
|
The broker code is existing, all I am doing is enhancement to the existing code in the form of email alert when somethign fails. I don’t think this existing set up is going to be changed in the near future.
For now do you have any other suggestions or directions for me so that i can research myself and improve this piece.
Assuming I have 3 different applications ( My original example )
Thank you for the valuable info |
|
Back to top |
|
 |
|