question

l-dobrev avatar image
0 Votes"
l-dobrev asked l-dobrev commented

Service Bus Topic subscriber scaling

Using a Topic in Service Bus via JMS+Spring.
The application uses @JmsListener to link to the topic.

I've created a non-durable, shared, pub-sub JmsListenerContainerFactory to use for that purpose.

The application works as expected when only one instance is deployed, but scaling the application ends up in every message to the topic being delivered to only one unpredictable subscriber instance, rather than all.
This turns the topic into what is effectively a queue, which is not expected.

How to configure the JMS topic/subscriber/listeners/factories/etc., so that multiple instances of the application would receive all the messages sent to/via the topic?

azure-service-busazure-spring-cloud
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MikeUrnun avatar image
0 Votes"
MikeUrnun answered l-dobrev commented

Hi @l-dobrev It seems that you're using a Shared non-durable subscriptions, can you try using Unshared non-durable subscriptions instead?

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@l-dobrev Just following up here on my answer above, please let me know it helped or if you had additional questions.

0 Votes 0 ·

@MikeUrnun apologies for the (really) late response.

Unfortunately JMS supports named consumers/subscribers only for Durable and/or Shared subscribers.
Attempting to use a non-Shared + non-Durable subscription ends up crashing:

 javax.jms.InvalidDestinationException: The messaging entity '<service-bus-name>:Topic:<topic-name>|qpid-jms:receiver:ID:78b7a4ec-1858-477a-9be4-1f9928b04c04:1:1:1:<topic-name>' could not be found. To know more visit https://aka.ms/sbResourceMgrExceptions.  TrackingId:0e9af248-6a7a-433e-9c30-58c36f39d967_B24, SystemTracker:<service-bus-name>:Topic:<topic-name>|qpid-jms:receiver:ID:78b7a4ec-1858-477a-9be4-1f9928b04c04:1:1:1:<topic-name>, Timestamp:2021-10-05T17:12:40 TrackingId:7ec61216723a4a388874c542e5b628a4_G27, SystemTracker:gateway7, Timestamp:2021-10-05T17:12:40 [condition = amqp:not-found]

0 Votes 0 ·