I am trying to execute springboot
application in wildfly 27
to connect and listen to JMS messages from azure service bus.
Same code is working fine when started with embedded tomcat. But if I exclude tomcat and deploy same war file in wildfly
it doesn't work.
Error Cause: Cannot create durable subscription - client ID has not been set
How do I get it working in WildFly?
@SpringBootApplication
@EnableJms
public class JiraServiceBusApplication extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(JiraServiceBusApplication.class, args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(JiraServiceBusApplication.class);
}
}
@JmsListener(destination = TOPIC_NAME, containerFactory = "topicJmsListenerContainerFactory",
subscription = SUBSCRIPTION_NAME, concurrency = "1")
public void receiveMessage(Message message) throws JMSException {
spring.jms.servicebus.connection-string=Endpoint=sb://xxxxxxxx.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=xxxxxxxxxxxxxxxxxx+ASbJ7sBvY=
spring.jms.servicebus.topic-client-id=xxxxxxxxx-xxxxxxxxx-xxxxxxxx
spring.jms.servicebus.pricing-tier=standard
When using Spring Boot with an embedded Tomcat server, the connection is managed by the embedded server itself.
JMS Configuration to WildFly:
<jms-queue>
or<jms-topic>
configuration for your JMS destination.standalone.xml
file in the WildFly configuration directory, Locate the<subsystem xmlns="urn:jboss:domain:messaging-activemq:4.0">
section in the configuration.Reference: