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 Java / JMS » receive not removing message from queue

Post new topic  Reply to topic
 receive not removing message from queue « View previous topic :: View next topic » 
Author Message
aburton
PostPosted: Fri Sep 03, 2004 6:14 am    Post subject: receive not removing message from queue Reply with quote

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
View user's profile Send private message
bower5932
PostPosted: Fri Sep 03, 2004 6:33 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
aburton
PostPosted: Fri Sep 03, 2004 6:39 am    Post subject: Reply with quote

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
View user's profile Send private message
aburton
PostPosted: Fri Sep 03, 2004 6:40 am    Post subject: Reply with quote

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
View user's profile Send private message
JLRowe
PostPosted: Fri Sep 03, 2004 6:45 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
vennela
PostPosted: Fri Sep 03, 2004 6:48 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
aburton
PostPosted: Fri Sep 03, 2004 6:51 am    Post subject: Reply with quote

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
View user's profile Send private message
aburton
PostPosted: Fri Sep 03, 2004 6:56 am    Post subject: Reply with quote

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
View user's profile Send private message
JLRowe
PostPosted: Fri Sep 03, 2004 7:07 am    Post subject: Reply with quote

Yatiri

Joined: 25 May 2002
Posts: 664
Location: South East London

Message acknowledgement is a poor man's transaction, for performance reasons you can specify when you want to acknowledge that you have processed all messages received so far and that they should be removed from the queue.

Check out the java docs for more details:

http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/jms/Session.html#CLIENT_ACKNOWLEDGE

And please do get the latest fix pack.
Back to top
View user's profile Send private message Send e-mail
aburton
PostPosted: Fri Sep 03, 2004 7:11 am    Post subject: Reply with quote

Newbie

Joined: 03 Sep 2004
Posts: 7
Location: Limerick, Ireland

Will do. Ta very much.
Back to top
View user's profile Send private message
aburton
PostPosted: Fri Sep 03, 2004 7:30 am    Post subject: Reply with quote

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
View user's profile Send private message
RogerLacroix
PostPosted: Fri Sep 03, 2004 7:41 am    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Hi,

CSD07 is the latest maintenance level for both.

Regards,
Roger Lacroix
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » receive not removing message from queue
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.