-1

How can i pass multiple queue name to my JmsListener.

@JmsListener(destination = "#{'${solace.jms.queueNames}'.split(',')}"

In my property file:

solace.jms.queueNames =q1,q2,q3

But when I start the Spring Boot app I get the below error:

.s.j.l.DefaultMessageListenerContainer  : Setup of JMS message listener invoker failed for destination '[Ljava.lang.String;@1b30a54e' - trying to recover. Cause: Error creating consumer - internal error (Queue name "[Ljava.lang.String;@1b30a54e" contains illegal character [;])

How to resolve it?

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
hello world
  • 171
  • 3
  • 13
  • If you want to listen on three queues, you will have to have three JMSListeners. – Doug Grove Feb 18 '22 at 13:30
  • Does this answer your question? [Adding Dynamic Number of Listeners(Spring JMS)](https://stackoverflow.com/questions/34063230/adding-dynamic-number-of-listenersspring-jms) – Justin Bertram Feb 18 '22 at 13:51

1 Answers1

1

You can define multiple @JMSListener

@JmsListener(destination = "${solace.jms.queueNames[0]}")
@JmsListener(destination = "${solace.jms.queueNames[1]}")
@JmsListener(destination = "${solace.jms.queueNames[2]}")