🎄 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.

Transacted sessions and order of messages

Hi all, I have a question. Suppose following publishing scenarios. All sessions are transacted, created from one particular connection, all steps are executed sequentially from one thread.

Scenario 1:
Session1.transaction1 --> 1,2
Session1.commit
Session2.transaction2 --> 3,4
Session2.commit
Session1.transaction3 --> 5,6
Session1.commit

Scenario 2:
Session1.transaction1 --> 1,2
Session1.commit
Session1.transaction2 --> 3,4
Session1.commit
Session1.transaction3 --> 5,6
Session1.commit

What are the messages order guarantees in Solace ?
According JMS spec (6.2.9.2) " A transaction’s order of messages to a particular destination is significant"
It seems like in scenario 2 messages will be ordered and consumer will consume 1,2,3,4,5,6.
Am I right ?
What about scenario 1 ?
Thanks.

Answers

  • Aaron
    Aaron Member, Administrator, Moderator, Employee Posts: 644 admin

    Hi Игорь Попов..! Yes, you're correct: the order of messages in both scenarios would be maintained, and the consumer would receive 1, 2, 3, 4, 5, 6. Even if you weren't to use transactions, order would be maintained since you're publishing from a single thread.

  • TomF
    TomF Member, Employee Posts: 412 Solace Employee

    Expanding on what Aaron said, in general, the ordering rule in Solace is "the order on reception is preserved." In other words, what matters is the order the messages were received at the broker. For single threaded producers that's easy... :smile: