Sanjay Chandak
Sanjay Chandak

Reputation: 71

Spring boot with tibco jms listener

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 ?

Upvotes: 5

Views: 13198

Answers (1)

Ratish
Ratish

Reputation: 101

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
}

Upvotes: 6

Related Questions