ballerina-platform / ballerina-library

The Ballerina Library
https://ballerina.io/learn/api-docs/ballerina/
Apache License 2.0
136 stars 58 forks source link

XA transactions fail with JMS #6398

Open daneshk opened 5 years ago

daneshk commented 5 years ago

Issue by orthoxerox Wednesday Dec 05, 2018 at 12:04 GMT Originally opened as https://github.com/ballerina-platform/ballerina-lang/issues/12517


Description: See gist.

If I change connectionFactoryName to "ConnectionFactory", the message is still not sent, but at least I get it back in Q1 when the service is killed.

I can change acknowledgementMode to "AUTO_ACKNOWLEDGE" and the message is delivered to Q2, but I need cross-broker XA support in production.

Steps to reproduce:

  1. Run Apache Artemis broker, create one user and anycast queues Q1 and Q2
  2. Update user credentials in bridge.bal from the gist
  3. Run ballerina run -e b7a.log.level=TRACE bridge.bal
  4. Insert one message into Q1
  5. Observe no "Message sent" trace
  6. Kill ballerina service
  7. Observe in Artemis console that the message is neither in Q1 nor Q2

Affected Versions:

Ballerina 0.983.0

OS, DB, other environment details and versions:

daneshk commented 5 years ago

Comment by orthoxerox Wednesday Dec 05, 2018 at 22:23 GMT


Update: if I wrap the body of onMessage in transaction, the send operation completes, but any unhandled exceptions still do not return the message to Q1 or broker's default DLQ.

daneshk commented 5 years ago

Comment by aashikam Friday Dec 07, 2018 at 09:06 GMT


Currently the Ballerina JMS module doesn't support XA transactions. We have added it to our roadmap hoping to support that by Q1 next year.

daneshk commented 5 years ago

Comment by orthoxerox Friday Dec 07, 2018 at 09:43 GMT


Ah, I see, thank you. Then this page is incorrect: https://ballerina.io/learn/by-example/xa-transactions.html

daneshk commented 5 years ago

Comment by orthoxerox Friday Dec 07, 2018 at 14:12 GMT


One more note: your current approach to creating JMS connections cannot obtain an XA connection from IBM MQXAConnectionFactory, as it returns an MQConnection from createConnection() and returns an MQXAConnection only from createXAConnection().

daneshk commented 5 years ago

Comment by anupama-pathirage Tuesday Dec 11, 2018 at 13:34 GMT


Created https://github.com/ballerina-platform/ballerina-lang/issues/12712 to track the documentation issue.