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 IndexIBM MQ Java / JMSSending Message in MQJMS transacted session, no exception

Post new topicReply to topic
Sending Message in MQJMS transacted session, no exception View previous topic :: View next topic
Author Message
abhay09
PostPosted: Mon Jul 17, 2017 2:21 am Post subject: Sending Message in MQJMS transacted session, no exception Reply with quote

Acolyte

Joined: 31 May 2016
Posts: 66

Hi Guys,


I have gone through the IBM docs which says

"For messages sent in a transacted session, the application ultimately determines whether the queue manager has received the messages safely when it calls commit()."

Ref: https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.0.1/com.ibm.mq.csqzaw.doc/jm41220_.htm


Scenario:
I have an application that reads message from inbound queue and put in outbound queue and this whole process is under XA txn.

Now, if put is inhibited on outbound queue, then producer.send() is not throwing any exception and exception is raised only when we did txn.commit.

Raised exception is generic XA exception which is not stating the root cause of failure like "put inhibited" or any mq reason code.


Question:

1.) Can producer.send() throw any exception in transacted session (XA) or only txn.commit will throw exceptions for any issue in delivery?

2.) For any failure in message delivery, How can we get the root cause of failure (like JMS error code/MQ error code) as txn.commit is throwing only XA exceptions.?


Please suggest as it is v imp.

Any help will be appreciated.



Many Thanks!
Back to top
View user's profile Send private message
zpat
PostPosted: Mon Jul 17, 2017 4:17 am Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5849
Location: UK

Always report the linked exception when using MQ with Java.
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.
Back to top
View user's profile Send private message
abhay09
PostPosted: Sun Jul 23, 2017 10:05 pm Post subject: Reply with quote

Acolyte

Joined: 31 May 2016
Posts: 66

No Linked exception is coming as MQ exception.
Only XA Exception is thrown.

Please let me know any way to throw Exceptions for any issue in transacted session with mqjms api.
Back to top
View user's profile Send private message
tomleend
PostPosted: Tue Jul 25, 2017 2:40 am Post subject: Reply with quote

Acolyte

Joined: 24 Jan 2014
Posts: 51

Quote:
1.) Can producer.send() throw any exception in transacted session (XA) or only txn.commit will throw exceptions for any issue in delivery?


MessageProducer.send(...) can throw a JMSException:

https://docs.oracle.com/javaee/7/api/javax/jms/MessageProducer.html#send-javax.jms.Message-

regardless of whether the JMS Session is transacted or not.

Quote:
2.) For any failure in message delivery, How can we get the root cause of failure (like JMS error code/MQ error code) as txn.commit is throwing only XA exceptions.?


Failures in XA calls only contain XA return codes, not MQ reason codes.


Have you configured your JMS Queue, used for your application's outbound messaging, for Asynchronous Puts? Perhaps review this:

https://www.ibm.com/developerworks/community/blogs/messaging/entry/A_Common_Cause_of_The_method_xa_end_has_failed_with_errorCode_100_Asynchronous_Puts?lang=en
Back to top
View user's profile Send private message
abhay09
PostPosted: Wed Jul 26, 2017 4:48 am Post subject: Reply with quote

Acolyte

Joined: 31 May 2016
Posts: 66

yes you are right.
We can set
queue.setPutAsyncAllowed( WMQConstants.WMQ_PUT_ASYNC_ALLOWED_DISABLED);”


Then getting exceptions in between txn also.

Thanks!
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexIBM MQ Java / JMSSending Message in MQJMS transacted session, no exception
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.