Author |
Message
|
aburton |
Posted: Fri Sep 03, 2004 6:14 am Post subject: receive not removing message from queue |
|
|
 Newbie
Joined: 03 Sep 2004 Posts: 7 Location: Limerick, Ireland
|
I have coded an MQ client in java that puts and receives messages from a queue. The client uses the mq jms classes. When I put a message on a queue and then later try to receive the message using the receiveNoWait method on a QueueReceiver instance it retrieves the message from the queue. However, afterwards when I check the queue the message still exists on the queue. I've tried running my client multiple times but I always get the same result. It's almost as if a rollback is occurring but the session is definately not transacted. I'm not getting any exceptions in my code. I'm connecting to the queue in client mode. My client is running on a windows platform and the queue manager and queues are running on a Sun Solaris box. I'm using JDK 1.3 but I've also tested with 1.4.2.
Below is the message as it exists on the queue and the manifest file showing the version of the jars I'm using. Anyone got any ideas why the message is not being removed from the queue?
Thanks,
Alan
AMQSBCG0 - starts here
**********************
MQOPEN - 'OAO_TST_01'
MQGET of message number 1
****Message descriptor****
StrucId : 'MD ' Version : 2
Report : 0 MsgType : 1111
Expiry : 5777 Feedback : 0
Encoding : 273 CodedCharSetId : 1208
Format : 'MQSTR '
Priority : 4 Persistence : 1
MsgId : X'414D5120514D415F53554E4445563032412F4F5620003D01'
CorrelId : X'000000000000000000000000000000000000000000000000'
BackoutCount : 0
ReplyToQ : ' '
ReplyToQMgr : 'QMA_SUNDEV02 '
** Identity Context
UserIdentifier : 'mqm '
AccountingToken :
X'0331313300000000000000000000000000000000000000000000000000000006'
ApplIdentityData : ' '
** Origin Context
PutApplType : '28'
PutApplName : 'Websphere MQ Client for Java'
PutDate : '20040903' PutTime : '13353331'
ApplOriginData : ' '
GroupId : X'000000000000000000000000000000000000000000000000'
MsgSeqNumber : '1'
Offset : '0'
MsgFlags : '0'
OriginalLength : '-1'
**** Message ****
length - 14 bytes
00000000: 5445 5354 204D 4553 5341 4745 2031 'TEST MESSAGE 1 '
Manifest-Version: 1.0
Name: com/ibm/mq/
Sealed: false
Implementation-Version: 5.300 - j530-L021008
Specification-Title: WebSphere MQ classes for Java
Specification-Version: 5.300
Implementation-Title: WebSphere MQ classes for Java
Created-By: 1.3.1_01 (Sun Microsystems Inc.)
Class-Path: com.ibm.mq.jar
Implementation-Vendor: IBM Corporation
Specification-Vendor: IBM Corporation |
|
Back to top |
|
 |
bower5932 |
Posted: Fri Sep 03, 2004 6:33 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
I'd almost bet that you are in a transaction and that you are getting your message rolled back automatically. Have you tried to issue the commit call to see if the message 'goes away'? |
|
Back to top |
|
 |
aburton |
Posted: Fri Sep 03, 2004 6:39 am Post subject: |
|
|
 Newbie
Joined: 03 Sep 2004 Posts: 7 Location: Limerick, Ireland
|
As stated in the original posting I'm definately not using transacted session. When I create the session I pass false for the transacted parameter.
Code: |
session = aQueueConnection.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);
|
I then create a QueueReceiver as follows:
Code: |
queueReceiver = session.createReceiver(ioQueue);
|
I've debugged the code to make sure the transacted attribute on the created session instance is false.
Thanks,
Alan |
|
Back to top |
|
 |
aburton |
Posted: Fri Sep 03, 2004 6:40 am Post subject: |
|
|
 Newbie
Joined: 03 Sep 2004 Posts: 7 Location: Limerick, Ireland
|
Sorry forgot to answer your original question. Yes I tried calling commit on the session but this caused an exception as the session was not transacted.
Alan |
|
Back to top |
|
 |
JLRowe |
Posted: Fri Sep 03, 2004 6:45 am Post subject: |
|
|
 Yatiri
Joined: 25 May 2002 Posts: 664 Location: South East London
|
I see you are using acknowledge mode of CLIENT_ACKNOWLEDGE, are you acknowledging the message after processing it? |
|
Back to top |
|
 |
vennela |
Posted: Fri Sep 03, 2004 6:48 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Also:
Apply the latest CSD because you show you are not running with any CSD |
|
Back to top |
|
 |
aburton |
Posted: Fri Sep 03, 2004 6:51 am Post subject: |
|
|
 Newbie
Joined: 03 Sep 2004 Posts: 7 Location: Limerick, Ireland
|
Nope. Should I be invoking message.acknowledge() before closing the session? I'll try that now and see. |
|
Back to top |
|
 |
aburton |
Posted: Fri Sep 03, 2004 6:56 am Post subject: |
|
|
 Newbie
Joined: 03 Sep 2004 Posts: 7 Location: Limerick, Ireland
|
That was it. What exactly is happening? If I don't acknowledge, does a recover get triggered on the session close?
Alan |
|
Back to top |
|
 |
JLRowe |
Posted: Fri Sep 03, 2004 7:07 am Post subject: |
|
|
 Yatiri
Joined: 25 May 2002 Posts: 664 Location: South East London
|
|
Back to top |
|
 |
aburton |
Posted: Fri Sep 03, 2004 7:11 am Post subject: |
|
|
 Newbie
Joined: 03 Sep 2004 Posts: 7 Location: Limerick, Ireland
|
Will do. Ta very much.  |
|
Back to top |
|
 |
aburton |
Posted: Fri Sep 03, 2004 7:30 am Post subject: |
|
|
 Newbie
Joined: 03 Sep 2004 Posts: 7 Location: Limerick, Ireland
|
One last thing. What's the latest available fix pack for
1. Windows
2. Solaris
Thanks,
Alan |
|
Back to top |
|
 |
RogerLacroix |
Posted: Fri Sep 03, 2004 7:41 am Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
|
Back to top |
|
 |
|