1

I am using spring-boot-starter-activemq.

When I am trying to listen using multiple listeners each for a different topic with clientId then only ONE listener is able to connect to a topic at random remaining doesn't connect saying already connected with given clientId.

Below are properties set

  • spring.activemq.broker-url =tcp://localhost:61616?jms.clientID=test
  • spring.jms.listener.acknowledge-mode=auto
  • spring.jms.listener.concurrency=1

  • spring.jms.pub-sub-domain=true

========================================================================

Error Message

Could not refresh JMS Connection for destination 'TOPIC_1' - retrying using FixedBackOff{interval=5000, currentAttempts=5, maxAttempts=unlimited}. Cause: Broker: pdt-topics - Client: test already connected from tcp://localhost:61616*

Vas K
  • 93
  • 9

1 Answers1

0

You cannot have more than one client connected to a broker with the same client ID as per the JMS specification. If you are only subscribing to Topics without a durable subscription then you don't need the client ID but if you do want durables then each of your clients needs to have a unique ID in order for that to work.

Tim Bish
  • 17,475
  • 4
  • 32
  • 42
  • I am able to listen to different topics of same broker with same client Id in Spring 3.2.3, but when i try same thing in spring-boot it fails. – Vas K Jun 14 '18 at 08:00
  • That would imply that the client Id is not being set, or all subscribers are using the same pooled connection. JMS Spec is clear, can't connect with same ID from multiple connection. – Tim Bish Jun 14 '18 at 13:23