zoukankan      html  css  js  c++  java
  • springboot 简单使用 activemq 接收消息

    1.在pom.xml 加入配置文件

    <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-activemq</artifactId>
            </dependency>

    2.编辑代码

    import org.springframework.jms.annotation.JmsListener;
    
    @Component
    public class BpmReceiver {
    
        @Resource
        JdbcTemplate jdbcTemplate;
        
        @JmsListener(destination = "oa")
            public void  receivedMessage(String message){
            }
    }

    这个消息message 是从队列读取的消息。

    @JmsListener(destination = "oa")

    这个 destination  表示队列名称。

    3.编辑配置文件

    spring:
      activemq: 
        broker-url: tcp://localhost:62222

    这样程序就可以从指定的队列读取消息了。

     
  • 相关阅读:
    vue
    手写Promise
    Promise应用
    Promise
    JS_URL模块
    模板字符串应用
    JS-OOP
    jQuery——过时,但是经典,关注核心点即可。
    MySql补充
    offset系列
  • 原文地址:https://www.cnblogs.com/yg_zhang/p/10605186.html
Copyright © 2011-2022 走看看