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 » IBM MQ API Support » Can't catch the messages

Post new topic  Reply to topic Goto page 1, 2  Next
 Can't catch the messages « View previous topic :: View next topic » 
Author Message
mitoiuv
PostPosted: Wed Jul 21, 2010 6:51 am    Post subject: Can't catch the messages Reply with quote

Novice

Joined: 06 Jul 2010
Posts: 20

Hi,

I have a little problem regarding reading messages from a queue, I modified the MQget sample and I am able to read (print on the screen) the messages read from a queue in BROWSE mode .

The problem appears on a queue that is consumed by another application when the message was delivered.

The problem is like this.

I send a message to a queue, I stay with my "sniffer" on the queue(the destination) but the message is consumed by the external APP before I read it.

Is this a problem redarging speed or the APP could be locking the queue in some "special" manner.

If I stop the APP I can see the message in the queue and read it.

Thank you


Last edited by mitoiuv on Wed Jul 21, 2010 7:09 am; edited 1 time in total
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Jul 21, 2010 7:08 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

If there are two applications with an open handle and sitting in an MQGET-with-wait and a new message appears that matches the criteria that *both* are expecting, it is *undefined* which one will get the message.

There's no good reason to do what you are actually doing. There may be a good reason to fulfill the requirement you are trying to make, but you will have to do it in an entirely different way.
Back to top
View user's profile Send private message
mitoiuv
PostPosted: Wed Jul 21, 2010 7:10 am    Post subject: Reply with quote

Novice

Joined: 06 Jul 2010
Posts: 20

Hmm....that just rocked my world , what way would be that ? Have any suggestions ?

Thank you
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Jul 21, 2010 7:23 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

What are you *trying* to do, other than read the exact same message from two separate applications?
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jul 21, 2010 7:23 am    Post subject: Reply with quote

Grand High Poobah

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

mitoiuv wrote:
what way would be that ? Have any suggestions ?


Any number of ways & suggestions depending on why you're doing this, i.e. your requirement. Why exactly do you have 2 applications trying to read the same message from the same queue?

Details please.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mitoiuv
PostPosted: Wed Jul 21, 2010 9:52 pm    Post subject: Reply with quote

Novice

Joined: 06 Jul 2010
Posts: 20

I need two APP's for the following reasons:

- i have one APP that is always connected and doing it's job on the queue(that is reading/consuming the messages from that queue after they arrive)

- and I need another APP that I start only when I want to investigate a specific problem regarding some errors/issues that are in the messages.

So I need/have to able to use both in the same time without interfering with each other.
Back to top
View user's profile Send private message
mitoiuv
PostPosted: Wed Jul 21, 2010 9:54 pm    Post subject: Reply with quote

Novice

Joined: 06 Jul 2010
Posts: 20

mqjeff wrote:
What are you *trying* to do, other than read the exact same message from two separate applications?


That is exactly what I want to do
Back to top
View user's profile Send private message
zpat
PostPosted: Wed Jul 21, 2010 11:14 pm    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

One of the main benefits of MQ is that is does not allow more than one application to get the same message. One time delivery is useful.

If you want two applicationss to read the same message, send a copy to two different queues.
Back to top
View user's profile Send private message
mitoiuv
PostPosted: Thu Jul 22, 2010 12:31 am    Post subject: Reply with quote

Novice

Joined: 06 Jul 2010
Posts: 20

I was thinking at using MirrorQ to mirror that queue and read from the mirrored queue instead of the business queue.
Back to top
View user's profile Send private message
zpat
PostPosted: Thu Jul 22, 2010 1:11 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

In MQ v7, pub sub would be easier, with topic aliases.

Or use WMB to duplex the messages

Or use this open-source tool to do it

http://www.capitalware.biz/mmx_overview.html
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Jul 22, 2010 2:37 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Generally if an MQ application has trouble processing a specific message, it will turn around and put it back to another queue - an error queue or a backout queue.

It can then be investigated from there.

Keeping a separate copy of every single message for this purpose is usually seen as large overkill.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Jul 22, 2010 4:12 am    Post subject: Reply with quote

Grand High Poobah

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

mitoiuv wrote:
I was thinking at using MirrorQ to mirror that queue and read from the mirrored queue instead of the business queue.


As has been said many times, mirrorq is a piece of sample code and a) is not considered production strength & b) will be your problem to maintain & fix going forward

<plug>Though Cressida does sell something that does this & supports it </plug>

Also as my most worthy associate points out, if there are errors or issues the application should reject the message and write to an error queue for your investigiation.

If you do use mirrorq or similar to keep a copy of each message, how will you a) identify the failing message in among the (presumably) large number of successful ones and b) clear unwanted messages out of this copy queue?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mitoiuv
PostPosted: Thu Jul 22, 2010 4:40 am    Post subject: Reply with quote

Novice

Joined: 06 Jul 2010
Posts: 20

This APP is for testing, it is going to be developed only for this, now the problem is different...I tried to setup mirrorq to "clone" the queue and then use the first APP for reading messages from it but it seems that i'm doing something wrong.

I compiled mirrorq, put it in the /bin/ folder of MQ, but it is not trigerring... this is the config file that I used.

What am I doing wrong here ?

Code:


*   Queue to mirror business application queue
    DEFINE QLOCAL('RD92.XML.SYNC1.MIRROR') REPLACE +
           DESCR('Mirror queue for EXPLODE')

*   Staging queue used by explodeMirror
*   Set application up to put to this queue rather
*   than business application queue
    DEFINE QLOCAL('RD92.XML.SYNC1.STAGEQ') REPLACE +
           DESCR('Staging queue for EXPLODE') +
*   Shareable
           SHARE +
*   Trigger control on
           TRIGGER +
*   Trigger on first message
           TRIGTYPE (EVERY) +
           INITQ('RD92.EVTINITQ') +
           PROCESS('RD92.PROCESS')

*   Process definition to load explodeMirror
    DEFINE PROCESS('RD92.PROCESS')  REPLACE +
           DESCR('Trigger process for EXPLODE') +
           USERDATA('RD92.XML.SYNC1 RD92.XML.SYNC1.MIRROR') +
           APPLICID('mirrorq')



I started the trigger monitor to see what's happening but can't see any activity.

Code:

 runmqtrm -m RD92.MANAGER -q RD92.EVTINITQ
5724-H72 (C) Copyright IBM Corp. 1994, 2005.  ALL RIGHTS RESERVED.
WebSphere MQ trigger monitor started.

__________________________________________________
Waiting for a trigger message
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Jul 22, 2010 4:51 am    Post subject: Reply with quote

Grand High Poobah

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

mitoiuv wrote:
I compiled mirrorq, put it in the /bin/ folder of MQ, but it is not trigerring... this is the config file that I used.

What am I doing wrong here ?


Believing that mirrorq is a triggered app. It's a exit that's called by the internal WMQ process.

It's on this basis I warned you about it being non-production strength & your responsibility going forward. An exit with inefficient (i.e. sample) code or a minor problem with adversly affect queue manager performance. An exit with a bug will bring the queue manager crashing down.

Exits (even sample ones) are an advanced topic. Read some of the threads in here (especially Roger's) and the notes for the mirrorq sample.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Jul 22, 2010 5:34 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Vitor wrote:
mitoiuv wrote:
I compiled mirrorq, put it in the /bin/ folder of MQ, but it is not trigerring... this is the config file that I used.

What am I doing wrong here ?


Believing that mirrorq is a triggered app. It's a exit that's called by the internal WMQ process.


There's an older version that was a triggered app, I believe.

But that's the far back reaches of my memory, and it's really fuzzy in there.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ API Support » Can't catch the messages
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.