Author |
Message
|
girish_tharwani |
Posted: Wed Aug 14, 2002 6:46 am Post subject: Copy of Message |
|
|
 Voyager
Joined: 01 Aug 2001 Posts: 88 Location: Pune, India
|
I think I know the answer to this question but it does not hurt to ask; right .
I have a third party application that puts a message on a queue (say Q1).
But I need two copies of this message on two queues. Since I can not modify the application , I can write a program that reads Q1 and puts two copies of this message on two queues. Same can be done using an MQSI flow instead of the program. But is there any plane MQSeries way of doing this without using MQSI or any program. |
|
Back to top |
|
 |
girish_tharwani |
Posted: Wed Aug 14, 2002 6:56 am Post subject: |
|
|
 Voyager
Joined: 01 Aug 2001 Posts: 88 Location: Pune, India
|
When I say I know the answer, I mean to say that I do not know any third way of doing it. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Wed Aug 14, 2002 9:45 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Nope. You listed the 3 ways. Modify the putting app, add an MQSI flow, or make an app that intercepts the message on the other side and does the double put itself.
As an aside....
A while back on the list serve I proposed the idea of expanding the remote queue definition of a queue. Why limit it to to only 1 remote queue/ queue manager. Wouldn't it be cool to be able to have something like the following?
QueueManager1 has local queue called QueueA
QueueManager2 has local queue called QueueA
QueueManager3 has local queue called QueueA
QueueManager4 has local queue called LogQueueA
QueueManager4 has remote queue called QueueA
Remote QueueA on QM4 would be defined as follows:
DEFINE QREMOTE(QueueA)
RNAME1(QueueA) RQMNAME1(QueueManager1) XMITQ(ToTheHub) +
RNAME2(QueueA) RQMNAME2(QueueManager2) XMITQ(ToTheHub) +
RNAME3(QueueA) RQMNAME3(QueueManager3) XMITQ(ToTheHub) +
RNAME4(LogQueueA) RQMNAME() XMITQ()
Now we could administrativly control copies of messages. For some reason Hursley didn't see the value. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
girish_tharwani |
Posted: Wed Aug 14, 2002 9:54 am Post subject: |
|
|
 Voyager
Joined: 01 Aug 2001 Posts: 88 Location: Pune, India
|
Yeah, this is exactly what I had in my mind. I also feel that remote queue defination should be expanded to handle multiple queues and queue managers |
|
Back to top |
|
 |
clindsey |
Posted: Wed Aug 14, 2002 5:15 pm Post subject: |
|
|
Knight
Joined: 12 Jul 2002 Posts: 586 Location: Dallas, Tx
|
If you are looking for a utility to do the copy, go to the downloads and grab mirrorq from the c/c++ section. The source code is there so you can modify as needed to suite your needs but it will be a good start.
Charlie |
|
Back to top |
|
 |
jc_squire |
Posted: Wed Aug 14, 2002 5:57 pm Post subject: |
|
|
 Centurion
Joined: 14 Apr 2002 Posts: 105 Location: New Zealand
|
What about name lists? e.g.
for arguments sake lets say your third party application puts messages to Q1 (logical queue)
define a name list (called Q1 - this is not an actual queue) which contains the two queue names Q2 and Q3
the third party application opens & puts messages to the name list (Q1) and the same instance of the message will be put to Q2 & Q3
is this an option ?
Regards _________________ J C Squire
IBM Certified Specialist - MQSeries |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Aug 15, 2002 5:20 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
JC, I think you meant Distribution Lists, not Namelists. The only thing you can do to a namelist is open it to do an MQINQ call to get a list of all the names on there.
Distribution List can be opened and PUT to, but are used to PUT to a whole bunch of queues with one open/put/close call. They require coding changes in that you must build the MQOR structure, where you have to go and fill in all the queue names one by one with your code. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
girish_tharwani |
Posted: Thu Aug 15, 2002 5:28 am Post subject: |
|
|
 Voyager
Joined: 01 Aug 2001 Posts: 88 Location: Pune, India
|
Well , I am not sure if there is a way around it but I think a namelist can be opened with options MQOO_INQUIRE only. So you can not issue MQPUT on a namelist.
I tried opening a namelist with MQOO_OUTPUT option and got reason code 2045 (MQRC_OPTION_NOT_VALID_FOR_TYPE)  |
|
Back to top |
|
 |
girish_tharwani |
Posted: Thu Aug 15, 2002 5:32 am Post subject: |
|
|
 Voyager
Joined: 01 Aug 2001 Posts: 88 Location: Pune, India
|
Actually, Since morning I am trying to experiment with Dist. list and yeah it needs some coding changes in app. But I am dealing with a third party product that can not be changed. So it seems I am stuck. I will have to do some coding. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Aug 15, 2002 5:57 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Hey Grand Masters (Brandon, etc) What do you think about the idea of an enhanced remote queue? _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
bduncan |
Posted: Thu Aug 15, 2002 8:07 am Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
In theory it sounds like a nice enhancement. However, in your example above, imagine what would happen if 1 of the 4 channels were down. You put the message to the remote queue, the queue manager sees it can deliver to 3 of the 4 destinations, whereas the last copy will sit on the transmission queue. What does it do? Should it behave as an all or nothing? Otherwise we can end up in a state where 3/4 copies made it, and the 4th is sitting on a transmission queue. Or extend it further, one of the 4 transmission queues is full, now the 4th message should go to the dead letter queue. Do we still send the other 3 copies? _________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Aug 15, 2002 8:16 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Quote: |
1 of the 4 channels were down. You put the message to the remote queue, the queue manager sees it can deliver to 3 of the 4 destinations, whereas the last copy will sit on the transmission queue. What does it do? Should it behave as an all or nothing? |
I would say the same way that a Put to a regular remote queue def would work today if the channel were down. The message queues up and the app gets a RC of 0000. Today an app knows that only MQ got that message and will deliver it. A return code of 0000 does not mean that it even left the local QM, much less got delevired.
Quote: |
Or extend it further, one of the 4 transmission queues is full, now the 4th message should go to the dead letter queue. Do we still send the other 3 copies? |
This ones a little more tricky. I would say, yeah, let the 4th go to the DLQ and deliver the rest. But that doesn't sound all that good. What if as part of this enhancement the QM would know that the messages are part of a "group" and a new RC would indicate a XMIT queue error for a "group" put. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
jc_squire |
Posted: Thu Aug 15, 2002 12:15 pm Post subject: |
|
|
 Centurion
Joined: 14 Apr 2002 Posts: 105 Location: New Zealand
|
oh well, that was a bum call then ........  _________________ J C Squire
IBM Certified Specialist - MQSeries |
|
Back to top |
|
 |
bower5932 |
Posted: Fri Aug 16, 2002 8:03 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
|
Back to top |
|
 |
|