JMS transactions

In this section, let's see how we can include transactions in messaging. We shall first demonstrate messaging without transactions using a few scenarios. We shall first describe the scenarios and write a test case. Then, we shall develop an application around it. We shall demonstrate sending messages using the convertandsendmessage() method.

  • Scenario 1: This is a positive use case, which we have seen in previous sections as well.
    JMS transactions
    @Test public void testCorrectMessage() throws InterruptedException { Order order = new Order(0, "notification to deliver correctly"); ordersender.convertAndSendMessage(QUEUE_INCOMING, order); Thread.sleep(6000); ...

Get Mastering Spring Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.