🎄 Happy Holidays! 🥳
Most of Solace is closed December 24–January 1 so our employees can spend time with their families. We will re-open Thursday, January 2, 2024. Please expect slower response times during this period and open a support ticket for anything needing immediate assistance.
Happy Holidays!
Please note: most of Solace is closed December 25–January 2, and will re-open Tuesday, January 3, 2023.
Does solace topic support XA Transaction.
Am successfully tested XA Transaction when sending message to a queue directly. But when publishing msg (with XA transaction only) to a topic which is subscribed a queue, behavior is different. So does solace topic support XA Transaction ? or its there only for queue ( like when sending msg directly to queue)
Answers
-
Hi @Richa,
Since you're using XA transactions can you confirm you're using the JMS API?
Can you share more information about the behaviour you're seeing with topics. XA transactions should support queues and topics as defined in the docs:
. I'd suggest taking a look through and seeing if things are setup as expected.Hope that helps!
0 -
Hi @marc ,
Yes, am using JMS API only.
I have integrated weblogic with solace using solace resource adapter and trying to send msg on solace topic (subscribed by queue) with XA Transaction. So as soon as "send" method get executed, msg get reflected in solace. Ideally, it should wait for transaction manager's confirmation msg to get changes effective (i.e 2PC) and get reflect on solace broker.
Unlike topic, in case of queue (same queue which has subscription of above topic), msg get reflect only after transactional manager's confirmation at the end of my api. if any exception occurs post sending msg on solace and before my api completion, msg get rollback and does not show on solace (this is expected), which is not same in case of topic. (FYI- Queue direct-message is also disabled)
1 -
Thanks for the info @Richa.
Can you maybe share the code skeleton? I want to make sure the XA session is being created and the transaction started before messages are sent.
Something like this (pseduo code —> don't copy and paste)
XASession session = connection.createXASession(); Consumer c = session.createConsumer(...); session.getXAResource().start(...); // start transaction before sending or receiving messages p.send(m); session.getXAResrouce().end(...); session.getXAResrouce().commit(...);
thanks!0 -
Hi @marc,
PFB pseudo code that we are following:
//using weblogic initial context factory to create initialContext
ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup(...); // ConnectionFactory JNDI configured at weblogic
Connection connection = connectionFactory.createConnection();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Topic topic = (Topic) initialContext.lookup(...); // Topic/Queue JNDI configured at weblogic as per destination type
messageProducer.send(...); // sending msg on above topic/queue with persistent delivery modeHave used same code for Queue.
FYI - ConnectionFactory is container-managed with XA Transaction support.
Thanks!
1 -
Hey @Richa,
Hmm. I don't think this will matter since the application server is involved here and might be overriding it with it's config but can you change the
false
inSession session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
totrue
. That currently meanstransacted=false
Beyond that I'm out of ideas, can you open a support ticket? They'll be able to dig in deeper with you.
0