0
votes

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*

1

1 Answers

0
votes

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.