0

Thinking of migrating some JMS-based legacy to Alpakka, one of widely used patterns in the code is request/response with temporary queue (JMSReplyTo). Is it possible with Alpakka out of the box?

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
bobah
  • 18,364
  • 2
  • 37
  • 70

1 Answers1

1

Yes, Alpakka's JMS module does support JMSReplyTo. An example from the documentation:

val msgsIn = (1 to 10).toList.map { n =>
  JmsTextMessage(n.toString)
    .withHeader(JmsType("type"))
    .withHeader(JmsCorrelationId("correlationId"))
    .withHeader(JmsReplyTo.queue("test-reply")) // <---
    .withHeader(JmsTimeToLive(FiniteDuration(999, TimeUnit.SECONDS)))
    .withHeader(JmsPriority(2))
    .withHeader(JmsDeliveryMode(DeliveryMode.NON_PERSISTENT))
}
Jeffrey Chung
  • 19,319
  • 8
  • 34
  • 54
  • Thanks Jeffrey, but this would be a non-temporary queue. Temporary queues have a lifetime linked to a connection they are created in. And the connection used by the alpakka JMS stream is encapsulalted in the stream. So I guess the answer is a "no". – bobah Apr 22 '19 at 09:36