|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Browsing , but not deleting....HELP!!!!!!!!!! |
« View previous topic :: View next topic » |
Author |
Message
|
Monk |
Posted: Mon Jan 14, 2008 12:03 am Post subject: Browsing , but not deleting....HELP!!!!!!!!!! |
|
|
 Master
Joined: 21 Apr 2007 Posts: 282
|
Hi All,
I have a problem w MQ.
What i m trying to do is pretty simple.
1. Browse the Message
2. if ( my message found )
delete the message
3. browse next message
I m using C and MQ v5.3 CSD 12.
Following are my options for the above logic
do
{
browsegmo.Version = MQGMO_VERSION_2;
browsegmo.Options = MQGMO_NO_WAIT + MQGMO_BROWSE_NEXT;
browsegmo.MatchOptions = MQMO_NONE;
memcpy(pgmoin, &browsegmo, sizeof(MQGMO) );
printf("\n %d Messages found for queue '%s'",QDepth,Qname);
memcpy(md.MsgId, MQMI_NONE, sizeof(md.MsgId));
memcpy(md.CorrelId, MQCI_NONE, sizeof(md.CorrelId));
md.Version = MQMD_VERSION_2 ;
memcpy(pmdin, &md, sizeof(MQMD) );
memset(buffer,'\0',buflen);
MQGET(HCon, /* connection handle */
Herrorq, /* object handle */
pmdin, /* message descriptor */
pgmoin, /* get message options */
buflen, /* buffer length */
buffer, /* message buffer */
&messlen, /* message length */
&CompCode, /* completion code */
&QReason); /* reason code */
if ( /* my message found */)
{
memset(pgmoin,'\0',sizeof(MQGMO));
browsegmo.Version = MQGMO_VERSION_2;
browsegmo.Options = MQGMO_NO_WAIT + MQGMO_BROWSE_MSG_UNDER_CURSOR ;
browsegmo.MatchOptions = MQMO_NONE;
memcpy(pgmoin, &browsegmo, sizeof(MQGMO) );
MQGET(...................)
}
i Know lots of ppl hv asked this question.
But i need some help w above code..
It doesnt do as expected..it simply browses the message , and when the required message is found..it doesnt delete it , even after specifying
MQGMO_BROWSE_MSG_UNDER_CURSOR option.
Can someone tell me what/where am i going wrong?.
Thanks a ton.
I m losing my hair..over this.. _________________ Thimk |
|
Back to top |
|
 |
zpat |
Posted: Mon Jan 14, 2008 12:06 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
You know, reading the App Prog Ref manual does help. As does using MQGMO_MSG_UNDER_CURSOR
BROWSE means BROWSE!
Quote: |
MQGMO_BROWSE_MSG_UNDER_CURSOR
Browse message under browse cursor.
This option causes the message pointed to by the browse cursor to be
retrieved nondestructively, regardless of the MQMO_* options specified in
the MatchOptions field in MQGMO. |
|
|
Back to top |
|
 |
Monk |
Posted: Mon Jan 14, 2008 12:35 am Post subject: |
|
|
 Master
Joined: 21 Apr 2007 Posts: 282
|
ok. Thanx for that.
But how do i delete the messages now..
Do i have to re-open the queue in non-browse mode.
i m sure this is not the way..
i wrote the code based on the the sample provided by IBM.. _________________ Thimk |
|
Back to top |
|
 |
Monk |
Posted: Mon Jan 14, 2008 12:39 am Post subject: |
|
|
 Master
Joined: 21 Apr 2007 Posts: 282
|
FORGIVE ME FOR POSTING THIS .....
PROBLEM SOLVED... _________________ Thimk |
|
Back to top |
|
 |
VijayGoparaju` |
Posted: Wed Sep 17, 2008 12:18 am Post subject: |
|
|
Acolyte
Joined: 26 Aug 2008 Posts: 72
|
How you got the solution what is the error? |
|
Back to top |
|
 |
bower5932 |
Posted: Wed Sep 17, 2008 4:06 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
VijayGoparaju` wrote: |
How you got the solution what is the error? |
Monk wrote: |
i wrote the code based on the the sample provided by IBM.. |
The append you responded to is 9 months old. It might be quicker to look at the samples and read the manual. |
|
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
|
|
|
|