5

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 ?

Sanjay Chandak
  • 61
  • 1
  • 1
  • 4

1 Answers1

6

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
}
seenukarthi
  • 8,241
  • 10
  • 47
  • 68
Ratish
  • 91
  • 3
  • Nice response but I have surprising question - where to find ConnectionFactory interface? I have TibjmsConnectionFactory inside com.tibco.ems:tibjms JAR version 8.2, but I dont have javax.jms.ConnectionFactory... – kabeen Nov 30 '16 at 15:55
  • @kabeen I got the interface from geronimo-jms_1.1_spec-1.1.1.jar already present in my classpath. There is another discussion on similar lines. http://stackoverflow.com/questions/6334323/what-is-the-right-maven-dependency-for-javax-jms-classes – Ratish Jan 31 '17 at 10:20
  • 1
    Can any one please post whole project structure of JMS tibco using spring boot.as I am new in spring boot .I don't understand how to add JMS tibco – kanchan shegar Feb 28 '21 at 16:21