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 » General IBM MQ Support » Geting duplicate msgs and losing msgs

Post new topic  Reply to topic
 Geting duplicate msgs and losing msgs « View previous topic :: View next topic » 
Author Message
Drax
PostPosted: Sun Dec 09, 2012 5:36 pm    Post subject: Geting duplicate msgs and losing msgs Reply with quote

Novice

Joined: 16 Apr 2007
Posts: 12
Location: China

Hello all,

I got issues to get msgs from MQ server with my consumer, it happens 2-3 times one month,
working process of my consumer is as below(not in the same host with MQ server)
1. browse MQ data get_options.Options = MQGMO_WAIT | MQGMO_BROWSE_FIRST | MQGMO_LOCK;
2. insert into DB
3. delete MQ data get_options.Options = MQGMO_NO_WAIT | MQGMO_ACCEPT_TRUNCATED_MSG;

Not sure what cause such kind of issue, I didnt see any errors in MQ server side and App side...

need you help to suggest anything I can do to impove my consumer?
Back to top
View user's profile Send private message MSN Messenger
Vitor
PostPosted: Sun Dec 09, 2012 6:56 pm    Post subject: Re: Geting duplicate msgs and losing msgs Reply with quote

Grand High Poobah

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

Drax wrote:
need you help to suggest anything I can do to impove my consumer?


Don't use that code. Use the standard / best practice method of doing a destructive read under syncpoint, insert into the database in the same unit of work and then commit or rollback as appropriate.

Not only is it more efficient, it synchronizes (hence syncpoint) the WMQ activity with the database activity and is intended to eliminate the loss / duplication you're seeing.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Drax
PostPosted: Sun Dec 09, 2012 9:59 pm    Post subject: Re: Geting duplicate msgs and losing msgs Reply with quote

Novice

Joined: 16 Apr 2007
Posts: 12
Location: China

Vitor wrote:
Drax wrote:
need you help to suggest anything I can do to impove my consumer?


Don't use that code. Use the standard / best practice method of doing a destructive read under syncpoint, insert into the database in the same unit of work and then commit or rollback as appropriate.

Not only is it more efficient, it synchronizes (hence syncpoint) the WMQ activity with the database activity and is intended to eliminate the loss / duplication you're seeing.


thanks
Back to top
View user's profile Send private message MSN Messenger
zpat
PostPosted: Sun Dec 09, 2012 11:52 pm    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

In general you never need to use browse in an application.

Certainly learn and use the standard approach first. Do remember that MQ and DB syncpoints are only truly combined when using XA coordination.
Back to top
View user's profile Send private message
Drax
PostPosted: Mon Dec 10, 2012 9:51 pm    Post subject: Reply with quote

Novice

Joined: 16 Apr 2007
Posts: 12
Location: China

zpat wrote:
In general you never need to use browse in an application.

Certainly learn and use the standard approach first. Do remember that MQ and DB syncpoints are only truly combined when using XA coordination.


then I may need extra cost here I presume...
Back to top
View user's profile Send private message MSN Messenger
fjb_saper
PostPosted: Mon Dec 10, 2012 9:56 pm    Post subject: Reply with quote

Grand High Poobah

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

Drax wrote:
zpat wrote:
In general you never need to use browse in an application.

Certainly learn and use the standard approach first. Do remember that MQ and DB syncpoints are only truly combined when using XA coordination.


then I may need extra cost here I presume...

May be not. Licensing under 7.5 is different... but for licensing questions your partner is your IBM rep.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
zpat
PostPosted: Tue Dec 11, 2012 2:12 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

XA is a feature that MQ can use as a resource, or as a transaction coordinator.

Either way there is no additional cost, but it is more set up work.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Dec 11, 2012 6:27 am    Post subject: Reply with quote

Grand High Poobah

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

Drax wrote:
then I may need extra cost here I presume...


For what?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Drax
PostPosted: Wed Dec 12, 2012 6:00 pm    Post subject: Reply with quote

Novice

Joined: 16 Apr 2007
Posts: 12
Location: China

Vitor wrote:
Drax wrote:
then I may need extra cost here I presume...


For what?


For XA transactional client.. actually the APp, DB and MQ are not in the same server... and if I'm not wrong, if we need two-phase commitment here, at least from MQ side, we need to install the transactional client in App side which is not free now.. licensing might be different after we using MQ 7.5, but it is not yet planned...

only for cost saving.. I'm thinking if we could separate the message gettign and DB inserting into two UOW.. it will avoid the msgs losing as well and it is much cheaper...
Back to top
View user's profile Send private message MSN Messenger
Drax
PostPosted: Wed Dec 12, 2012 6:24 pm    Post subject: Reply with quote

Novice

Joined: 16 Apr 2007
Posts: 12
Location: China

Oh my bad, it seems the XA client is free now...

https://www.ibm.com/developerworks/mydeveloperworks/blogs/messaging/entry/xa_client_now_free_all_app_servers_all_platforms41?lang=en
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Geting duplicate msgs and losing msgs
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.