简体   繁体   English

带有 tibco jms 侦听器的 Spring Boot

[英]Spring boot with tibco jms listener

I am trying to listen Tibco ems queue (wants annotation based configuration) from SpringBoot.我正在尝试从 SpringBoot 收听 Tibco ems 队列(需要基于注释的配置)。 I don't see any example which described how to configure and listen Tibco ems queue from SpringBoot.我没有看到任何描述如何从 SpringBoot 配置和侦听 Tibco ems 队列的示例。

Any lead or example on this ?这方面的任何线索或例子?

Create a connection factory in the spring boot application class在spring boot应用类中创建连接工厂

@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 .对于发送消息,使用 JmsMessagingTemplate 的 send() 。

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
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM