Spring boot with tibco jms listener

Sanjay Chandak picture Sanjay Chandak · Sep 15, 2016 · Viewed 9.5k times · Source

I am trying to listen Tibco ems queue (wants annotation based configuration) from SpringBoot. I don't see any example which described how to configure and listen Tibco ems queue from SpringBoot.

Any lead or example on this ?

Answer

Ratish picture Ratish · Sep 30, 2016

Create a connection factory in the spring boot application class

@Bean
public ConnectionFactory connectionFactory(){

    TibjmsConnectionFactory connectionFactory = new TibjmsConnectionFactory(JMS_URL); 
    connectionFactory.setUserName(USERNAME);
    connectionFactory.setUserPassword(PASSWORD);

    return connectionFactory;
}

For sending message , use the send() of JmsMessagingTemplate .

The listener class should have an annotated method which has to be invoked for processing the message received from queue.

@JmsListener(destination = "queue_name")
public void receiveMessage(Message<T> message) {
   //Any processing to be done here
}