I have a Spring Boot application deployed in Tomcat 8. I want to start background thread when my spring boot application starts.This is my current implementation
@SpringBootApplication
public class JmsTopicListApplication {
public static void main(String[] args) {
SpringApplication.run(JmsTopicListApplication.class, args);
JMSListener jmsListener = new JMSListener("192.168.16.56",
"jms/topic/ORD_CLINT_PUSH","org.jboss.naming.remote.client.InitialContextFactory",
"http-remoting://192.168.16.56:4545","jms/RemoteConnectionFactorySTP",
"ishara","ishara@007");
jmsListener.start();
}
Is there any best possible way of doing this ?