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 ?
The JmsListener annotation defines the name of the Destination that this method should listen to and the reference to the JmsListenerContainerFactory to use to create the underlying message listener container.
You can access the JMS listener containers from the registry (all or by name) and call stop() on the one(s) you want; the container will stop after any in-process messages complete their processing.
The JMS Listener adapter operates in an asynchronous mode. It establishes an asynchronous listener on the queue or topic destination specified by the JNDI name of Destination field. When a qualified message arrives at the destination, the adapter immediately processes the message.
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
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With