|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Message consumer not browsing messages |
« View previous topic :: View next topic » |
Author |
Message
|
Rush124 |
Posted: Wed Jul 22, 2015 12:22 am Post subject: Message consumer not browsing messages |
|
|
Novice
Joined: 05 Aug 2014 Posts: 19
|
Hi,
I have implemented an asynchronous message consumption application.
Here I have used message consumer callback function which is registered for multiple queues. This function browses messages and then tells to another thread which deletes the message using different handlers (Hconn and Hobj).
Message delivery sequence for queues is set as FIFO.
But I encountered a scenario where messages with different priorities are put to a queue, message are not browsed.
As I know If Message delivery sequence is FIFO, callback function should function properly even for messages with different priorities.
What am I missing here?
Further more I would like to refer documentations on How asynchronous message consumption works. Is Triggering connected to asynchronous message consumption? (Queue's TRIGTYPE is set to FIRST in my application)
Any help would be appreciated. |
|
Back to top |
|
 |
PaulClarke |
Posted: Wed Jul 22, 2015 12:50 am Post subject: |
|
|
 Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
To answer your last question first.....triggering has nothing to do with asynchronous consume.
What makes you think that message priority stops the async. consume working properly ? Can you give a few more details about what you are doing ? What language are you using for example ?
One of the most common mistakes that people do is that they do something they shouldn't inside the consumer function. For example, issue an MQGET wait or similar. How are you passing the processing to the 'other' thread ?
Cheers,
Paul. _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
 |
Rush124 |
Posted: Wed Jul 22, 2015 1:44 am Post subject: |
|
|
Novice
Joined: 05 Aug 2014 Posts: 19
|
Hi Paul,
Thanks for replying.
Quote: |
What makes you think that message priority stops the async. consume working properly ? Can you give a few more details about what you are doing ? What language are you using for example ? |
I m using c++.
If the message delivery sequence of a queue is set 'priority' and messages with different priorities are put to the queue, async. consumer will not browse all the messages.
(That is if there are messages with priorities respectively 0,1,0,
then 3rd message will not be browsed. This is because, After browsing a message with high priority,browse cursor will not point to new msgs with lower priorities. )
(I am using MQGMO_BROWSE_NEXT the GMO option )
Quote: |
One of the most common mistakes that people do is that they do something they shouldn't inside the consumer function. For example, issue an MQGET wait or similar. How are you passing the processing to the 'other' thread ? |
Here after browsing the message(from message consumer function), message information is passed to a different thread. This thread connects to queue manager and uses non-shared type handle. Then same queue will be opened with 'MQOO_OUTPUT' as open option.
I am not clear about how the callback works. Does it poll for depths of the queues that are registered in MQCB function? |
|
Back to top |
|
 |
PaulClarke |
Posted: Wed Jul 22, 2015 2:31 am Post subject: |
|
|
 Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
Just think of an async. consume as an MQGET message loop which calls your function for each retrieved message.
So, in order to stop the message cursor 'problem' add the MQGMO_MARK_BROWSE_HANDLE/MQGMO_UNMARKED_BROWSE_MSG options to your MQGET options.
Cheers,
Paul. _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jul 22, 2015 6:25 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Rush124 wrote: |
I m using c++.
If the message delivery sequence of a queue is set 'priority' and messages with different priorities are put to the queue, async. consumer will not browse all the messages.
(That is if there are messages with priorities respectively 0,1,0,
then 3rd message will not be browsed. This is because, After browsing a message with high priority,browse cursor will not point to new msgs with lower priorities. )
(I am using MQGMO_BROWSE_NEXT the GMO option ) |
That is most probably a problem of your own doing...
Do you reset msgid, correlid, priority etc... (basically your MQMD) between 2 messages ? What happens if you reset the priority field prior to the get. Do you then get the 3rd message?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|