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 » Messages Missing from MQ

Post new topic  Reply to topic
 Messages Missing from MQ « View previous topic :: View next topic » 
Author Message
meetgaurav
PostPosted: Wed Oct 29, 2008 2:57 am    Post subject: Messages Missing from MQ Reply with quote

Voyager

Joined: 08 Sep 2008
Posts: 94

HI

I have one MDB running in OC4J that just picking the Messages from third party Queue and doing some business Logic and after that am putting the same message in Websphere MQ. Using XA transactions (CMT)..I checked no exceptions thrown by MDB..

Problem is
As soon as my MDB is processing am checking the currdepth of the Queue and it was showing 60 then 65 then 70. Once MDB complete the the Queue is showing 40 as currdepth am loosing some messages here..

Please assist me
Back to top
View user's profile Send private message
atheek
PostPosted: Wed Oct 29, 2008 3:04 am    Post subject: Reply with quote

Partisan

Joined: 01 Jun 2006
Posts: 327
Location: Sydney

Are you sure no application is consuming messages off the MQ
Back to top
View user's profile Send private message
meetgaurav
PostPosted: Wed Oct 29, 2008 3:11 am    Post subject: Reply with quote

Voyager

Joined: 08 Sep 2008
Posts: 94

Yes am sure... I checked.. Now am checking it was 35 messages only.
Back to top
View user's profile Send private message
atheek
PostPosted: Wed Oct 29, 2008 3:53 am    Post subject: Reply with quote

Partisan

Joined: 01 Jun 2006
Posts: 327
Location: Sydney

Are you setting expiry for the messages? Messages sitting on a queue won't get disappear as such unless

1. its consumed by an application
2. it got expired
3. its a non persistent message and there was a qmgr bounce

double check these for surety
Back to top
View user's profile Send private message
meetgaurav
PostPosted: Wed Oct 29, 2008 4:18 am    Post subject: Reply with quote

Voyager

Joined: 08 Sep 2008
Posts: 94

1. Am sure no other application consumes.
2. Del Mode:2 Priority:0 [b]Exp Time:5000000[/b]
3. How to make messages persistent ???

DELIVERY_OPTION = 2. I guess '2' mean Persistent ??
Back to top
View user's profile Send private message
atheek
PostPosted: Wed Oct 29, 2008 12:04 pm    Post subject: Reply with quote

Partisan

Joined: 01 Jun 2006
Posts: 327
Location: Sydney

So you are actually setting expiry to 5000 seconds. The message will expire and get removed from the queue if not consumed within 83 minutes.
Back to top
View user's profile Send private message
meetgaurav
PostPosted: Wed Oct 29, 2008 9:38 pm    Post subject: Reply with quote

Voyager

Joined: 08 Sep 2008
Posts: 94

HI
1 more clarification, Am using XA transaction in my MDB and am creating the session like

connection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);

whether i need to close the session by code or the CMT will take care of closing the session. Please assist me, Am using OC4J.
Back to top
View user's profile Send private message
atheek
PostPosted: Wed Oct 29, 2008 10:15 pm    Post subject: Reply with quote

Partisan

Joined: 01 Jun 2006
Posts: 327
Location: Sydney

Close all the JMS objects in the finally block
Back to top
View user's profile Send private message
meetgaurav
PostPosted: Wed Oct 29, 2008 10:54 pm    Post subject: Reply with quote

Voyager

Joined: 08 Sep 2008
Posts: 94

HI atheek,

Yes now every thing Fine..

My MDB picking a message from AQ and doing reservation and program logic and finally put the message in Webspehere MQ.

After putting the Message in MQ
In my MDB on message am throwing
throw new CreateException("TESTING XA");
But the MQ message is still there. But it was suppose to rollback rite..
MDB running in OC4J and am using CMT.
Back to top
View user's profile Send private message
atheek
PostPosted: Thu Oct 30, 2008 1:17 am    Post subject: Reply with quote

Partisan

Joined: 01 Jun 2006
Posts: 327
Location: Sydney

within the catch block call setRollbackOnly() of userTransaction. This will indicate to the container that the transaction has to be rolled back.

Between how did you address the sequencing ( cancelling ahead of reservation) scenario?
Back to top
View user's profile Send private message
meetgaurav
PostPosted: Thu Oct 30, 2008 3:57 am    Post subject: Reply with quote

Voyager

Joined: 08 Sep 2008
Posts: 94

Atheek,

Am creating the queue sessiosn like this, queueConnection.createQueueSession(true,Session.AUTO_ACKNOWLEDGE);

Am closing Queue connection only. Not sender or session

Also am calling this in Catch block
MessageDrivenContext hex_context.setrollbackonly();

But still the MQ message is in the Queue..

We are discussing abt the cancellation still
Back to top
View user's profile Send private message
atheek
PostPosted: Thu Oct 30, 2008 7:44 am    Post subject: Reply with quote

Partisan

Joined: 01 Jun 2006
Posts: 327
Location: Sydney

ok..you are doing the right thing by calling setRollbackonly() of the message driven context.Use a non transacted session for your mqput

queueConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Oct 30, 2008 5:38 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Depending on the appserver this will not work.
In WebSphere per example the global transaction will overwrite your session settings.
So using J2EE make sure you are using the right transactional attributes for your method/session. Requires new is good to do request response...

So if you do request/response scenario I suggest following
Global transaction call MDB. MDB calls method with requires new transaction to send the message and return the messageId.
Call a different method that can participate (or not) in the global transaction to receive the response message.

Remember that any resource (MQ / JMS) acquired by a thread should also be freed by this thread as soon as it is no longer needed.

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
meetgaurav
PostPosted: Fri Oct 31, 2008 3:43 am    Post subject: Reply with quote

Voyager

Joined: 08 Sep 2008
Posts: 94

But in OC4J the global transaction is not overridding the session settings. So am using code call to session.rollback() and session.commit()
Back to top
View user's profile Send private message
meetgaurav
PostPosted: Sat Nov 01, 2008 10:55 am    Post subject: Reply with quote

Voyager

Joined: 08 Sep 2008
Posts: 94

Now am controlling my AQ in Global transaction and MQ in Session settings. And this will resolve my issues for now..Also we are discussing about the reservation cancellation.
Thanks a lot to Atheek and FJB saber..
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Messages Missing from MQ
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.