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 » XA transaction Problem

Post new topic  Reply to topic Goto page 1, 2  Next
 XA transaction Problem « View previous topic :: View next topic » 
Author Message
meetgaurav
PostPosted: Fri Nov 07, 2008 11:00 pm    Post subject: XA transaction Problem Reply with quote

Voyager

Joined: 08 Sep 2008
Posts: 94

HI
I dont know whether this question is suitable to this forum or not.

Using OC4J 10.1.3.1 i've set up a message driven bean that consumes messages from a queue. I've got a scenario whereby on rare occasions my bean won't be able to process the message due to the absence of an external service. When this happens, i roll back the transaction so the message is returned to the queue, the idea being that it can be processed later when the external service may/may not be available.

The problem is that the message is redelivered straight away - i want to be able to specify a delay. Can anyone help?

Also the messages were redelivered 5 times and not able to Control the behaviour ??


I tryed below codes, nothing is worked out...
dequeue-retry-count="10"
dequeue-retry-interval="300".
max-delivery-count="2"
Back to top
View user's profile Send private message
meetgaurav
PostPosted: Fri Nov 07, 2008 11:31 pm    Post subject: Reply with quote

Voyager

Joined: 08 Sep 2008
Posts: 94

But for AQ, While creating the Queues, I will forward the values like retries count => 2, delay in retry => 60(seconds) and this is working fine. Is their anything available for Websphere MQ. While I creating the Queues and Qmanager whether I need to give any values please assist me if so..

Thanks
Back to top
View user's profile Send private message
atheek
PostPosted: Sat Nov 08, 2008 1:52 am    Post subject: Reply with quote

Partisan

Joined: 01 Jun 2006
Posts: 327
Location: Sydney

AFAIK, MQ Jms has no such feature. I may be wrong, just wait here for other gurus to confirm

We have an application that has a similar architecture . We use weblogic as app server and weblogic's jms support retry count and interval as AQ. What we have done is to use a MDB that acts a pass through between the MQ and a weblogic JMS queue. We have another MDB linked to the jms queue and this MDB does the business logic and associated validations. We made use of the retry count/interval feature available at weblogic queue to induce a redelivery delay. Since the JMS queue will be available as long as app server is running, messages will be persisted at MQ if app server is down or at JMS queue if external service is down and is redlivered only after a configured interval.
Back to top
View user's profile Send private message
atheek
PostPosted: Sat Nov 08, 2008 1:58 am    Post subject: Reply with quote

Partisan

Joined: 01 Jun 2006
Posts: 327
Location: Sydney

I remember fjb_saper once advised me that this could be configured at the deployment descriptors of mdb.. May be you can check with OC4J documentation how this can be done.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Nov 08, 2008 6:47 pm    Post subject: Reply with quote

Grand High Poobah

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

atheek wrote:
I remember fjb_saper once advised me that this could be configured at the deployment descriptors of mdb.. May be you can check with OC4J documentation how this can be done.

Great, you remembered! I was just going to give him the same advice.
And remind everybody that MDB implementations depend on the J2EE provider and are not equal... Each provider has it's own little quirks you will have to deal with.

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
atheek
PostPosted: Sat Nov 08, 2008 7:19 pm    Post subject: Reply with quote

Partisan

Joined: 01 Jun 2006
Posts: 327
Location: Sydney

Hi FJ, Are you sure it will work? Considering MQ's jms implementation doesn't support redelivery delay. I thought the trigger for asynchronous delivery is the jms provider (mq) rather than app (mdb). So for delivery related features only what is provided by jms provider (MQ) is available..
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Nov 08, 2008 7:28 pm    Post subject: Reply with quote

Grand High Poobah

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

atheek wrote:
Hi FJ, Are you sure it will work? Considering MQ's jms implementation doesn't support redelivery delay. I thought the trigger for asynchronous delivery is the jms provider (mq) rather than app (mdb). So for delivery related features only what is provided by jms provider (MQ) is available..

To tell you the truth, any implementation that looks at a redelivery delay looks mightyly complex behind the scenes. I would expect, especially in a multi-instance MDB environment that the message will be immediately available to any other instance of the MDB...
In my mind you should never rely on a redelivery delay from a provider...
If you need a delay implement it inside the MDB after looking at the redelivery count.... or after having caught the exception and before rethrowing it...

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
atheek
PostPosted: Sat Nov 08, 2008 7:36 pm    Post subject: Reply with quote

Partisan

Joined: 01 Jun 2006
Posts: 327
Location: Sydney

fjb_saper wrote:
In my mind you should never rely on a redelivery delay from a provider...


Apart from code portability, is there any other reason why we shouldn't be relying on provider.. I would expect to use the feature of the app server/jms provider rather than ask the programmer to write extra code to handle something that is already provided out of the box..
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Nov 08, 2008 7:45 pm    Post subject: Reply with quote

Grand High Poobah

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

atheek wrote:
fjb_saper wrote:
In my mind you should never rely on a redelivery delay from a provider...


Apart from code portability, is there any other reason why we shouldn't be relying on provider.. I would expect to use the feature of the app server/jms provider rather than ask the programmer to write extra code to handle something that is already provided out of the box..


But with JMS your code is supposed to be plug n play with the different providers. So what happens when one of those does not provide you with all the features you took advantage of? This just means you are locked into a subset of providers that do implement that feature...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
meetgaurav
PostPosted: Sun Nov 09, 2008 4:12 am    Post subject: Reply with quote

Voyager

Joined: 08 Sep 2008
Posts: 94

Hi FJB and Atheek

I tried some thing related to OC4J stuffs...

Sample orion-ejb-jar.xml

<message-driven-deployment
name="GiriMDB"
connection-factory-location= "java:comp/resource/prototypeRP/QueueConnectionFactories/myQCF"
destination-location="java:comp/resource/prototypeRP/Queue/rpTestQueue"
dequeue-retry-count="10"
dequeue-retry-interval="300"
listener-threads="1">

Nothing is worked out even I restarted my Application and OC4J too. But for AQ this is related to provider part. Dont know how to proceed further...please assiste Me

Thanks
Back to top
View user's profile Send private message
atheek
PostPosted: Sun Nov 09, 2008 2:59 pm    Post subject: Reply with quote

Partisan

Joined: 01 Jun 2006
Posts: 327
Location: Sydney

I really doubt whether this will work without the support of jms provider(MQ).

You have two other options:

1. Handle redelivery delay within your code as suggested by FJ. In the catch block of your ServiceNotAvailable exception, add a wait interval. Also you can check message.JMSXDeliveryCount to know if the redelivery count has exceeded the threshold and move the message to the backout queue if that is the desired behaviour

2.You can use a MDB or a messaging bridge component if OC4J supports that, ( weblogic does, a message bridge is a component that can be used to transfer messages between two jms destinations which can be setup by configuration alone) to transfer the message from a MQ to AQ and then configure the MDB which implements the business logic to poll this AQ.
The first MDB will be just a pass through. Assuming AQ will be available as long as app server is running. You can configure the redelivery settings at AQ.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Nov 09, 2008 3:03 pm    Post subject: Reply with quote

Grand High Poobah

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

Oracle also has an MQ/AQ messaging gateway that you are probably already licensed for. You might just as well use and stay with AQ for your mdbs...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
meetgaurav
PostPosted: Sun Nov 09, 2008 8:07 pm    Post subject: Reply with quote

Voyager

Joined: 08 Sep 2008
Posts: 94

I guess you masters were confused little bit. Even the problem is from my side, Not explained correctly..

We have 3 projects

1. MQ
2. Tibco
3. AQ

We completed 2 & 3. In the 1st the MDB is connected with the MQ one end and another is DB2 Database. MDB will pick a message from MQ and update the DB2.. Could you please assist me how to set wait interval in my MDB


Also I know that currently this is working in default behaviour, Am getting the same message for 5 times.. Not able to Over ride this feature
MaxDeliveryCnt (integer, default = 5)
Back to top
View user's profile Send private message
atheek
PostPosted: Sun Nov 09, 2008 9:13 pm    Post subject: Reply with quote

Partisan

Joined: 01 Jun 2006
Posts: 327
Location: Sydney

What was told to you is that you may not be able to set redelivery delay with MQ as MQ's jms doesn't support it.

So if you dont want to handle it code at MDB,then instead of

MQ-MDB-DB2, you may have to setup something like

MQ - MDB(Pass thru )/message gateway - AQ - MDB - DB2 with redelivery settings configured at AQ
Back to top
View user's profile Send private message
meetgaurav
PostPosted: Sun Nov 09, 2008 9:57 pm    Post subject: Reply with quote

Voyager

Joined: 08 Sep 2008
Posts: 94

Hi atheek

Am sorry am not getting you. Also am not aware of MDB(Pass thru )

Could you please explain me or any code samples.

Thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ Java / JMS » XA transaction Problem
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.