ballerina-platform / ballerina-lang

The Ballerina Programming Language
https://ballerina.io/
Apache License 2.0
3.68k stars 751 forks source link

XA transactions fail with JMS #12517

Closed orthoxerox closed 5 years ago

orthoxerox commented 5 years ago

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:

orthoxerox commented 5 years ago

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.

aashikam commented 5 years ago

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.

orthoxerox commented 5 years ago

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

orthoxerox commented 5 years ago

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().

anupama-pathirage commented 5 years ago

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

daneshk commented 5 years ago

I am closing this issue. Since we moved JMS module to https://github.com/wso2-ballerina/module-jms repository. Please refer wso2-ballerina/module-jms#20 to get latest updates of this issue