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 » How to commit with Multithreaded client

Post new topic  Reply to topic
 How to commit with Multithreaded client « View previous topic :: View next topic » 
Author Message
zzha99
PostPosted: Thu Jul 30, 2009 12:16 am    Post subject: How to commit with Multithreaded client Reply with quote

Newbie

Joined: 29 Jul 2009
Posts: 2

In order to speed up data polling from server, we programmed two threads to access the same queue, and each thread will commit once if it has successfully downloaded 100 messages and saved them to a file. My problem here is if one thread fails to save messages, and another thread has committed, we may not able to re-download the messages failed by the first thread.

Is here any good way to deal with such problem?

P.S, we have to use multi-threaded client to keep up with the server.

Thanks in advance.
Back to top
View user's profile Send private message
AkankshA
PostPosted: Thu Jul 30, 2009 12:27 am    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

what were the factors taken into consideration while deciding the number 100 for a commit ??? why not commit each message ?
_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
WMBDEV1
PostPosted: Thu Jul 30, 2009 1:10 am    Post subject: Re: How to commit with Multithreaded client Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

zzha99 wrote:
we may not able to re-download the messages failed by the first thread.


Wont they be in a backout queue? You could then process them one at a time from this queue until the "bad" message is encountered when its finally moved to the error queue (assuming the error was due to a bad input message rather than a transient failure in which case all the message could be processed).
Back to top
View user's profile Send private message
zpat
PostPosted: Thu Jul 30, 2009 1:33 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Each thread will have a unique connection handle to the queue manager and commits will be separate.

Unless you implement handle sharing (which I suggest you don't).

If one thread backs out messages, they will become available to the other thread to get.

Move to a poison (backout re-queue) queue only if the message backout count exceeds a certain value (backout re-queue threshold) to prevent a loop.

These values can be held in the queue definition and inquired on.
Back to top
View user's profile Send private message
zzha99
PostPosted: Thu Jul 30, 2009 6:00 pm    Post subject: Reply with quote

Newbie

Joined: 29 Jul 2009
Posts: 2

Thanks for your replies.

Quote:

what were the factors taken into consideration while deciding the number 100 for a commit ??? why not commit each message ?

Commit each message made us not able to catch up the server.

Quote:

Each thread will have a unique connection handle to the queue manager and commits will be separate.

If one thread backs out messages, they will become available to the other thread to get.

If this is true, I really don't know why we lost data. That was happened when a blackout hit our city and we lost a few hundred messages during power outage.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Jul 31, 2009 6:38 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

zzha99 wrote:
f this is true, I really don't know why we lost data. That was happened when a blackout hit our city and we lost a few hundred messages during power outage.


The message were probably set as non-persistent. These message don't survive things like recovery from a power outage induced queue manager crash.
_________________
Honesty is the best policy.
Insanity is the best defence.
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 » How to commit with Multithreaded client
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.