Solace Community is getting a facelift!

On March 3rd we will be starting the process of migrating Solace Community to a new platform. As a result, Solace Community will go in to a temporary read-only state. You will still be able to come onto Solace Community and search through posts to find answers, but you won't be able to ask questions, post comments, or react in any way.

We hope to have the migration complete by Wednesday March 5th (or sooner), so please keep an eye out!

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: 668 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:

This Month's Leaders

This Week's Leaders