JMS Shared Durable Subscribers

A JMS consumer binding can bind to a shared durable subscription, enabling multiple consumers to share the load of messages published to the subscription. Durable subscriptions accumulate messages even when all consumers are offline, ensuring that no messages are lost.

To consume from a shared durable subscription, the following must be configured:

  • spring.cloud.stream.jms.bindings.<binding_name>.consumer.destination-type should be set to a topic. unknown can also be used as long as the destination resolves to a topic.

  • spring.cloud.stream.jms.bindings.<binding_name>.consumer.durable-subscription-name must be specified with the name of the subscription.

  • spring.cloud.stream.bindings.<binding_name>.destination must be set to the name of the topic on which the subscription is created.

spring:
  cloud:
    stream:
      bindings: 
	 input-0:
	   destination: topic/1
	   binder: jms
      jms:
	 bindings:
          input-0:
            consumer:
              destination-type: topic
              durable-subscription-name: subscriptionName