ActiveMQ笔记42-SpringBoot整合ActiveMQ之主题生产者
新建maven工程,我的工程名叫SpringBootActiveMQTopicProducer。 pom.xml,application.yml参考这篇博客: https://blog.csdn.net/qq_36059561/article/details/103834916 注意需要修改的一个地方,在application.yml中spring.jms.pub-sub-domain的值要设置成true,表示topic,下面的myqueue: boot-activemq-queue改成mytopic: boot-activemq-topic。 创建ConfigBean.java,编写代码,代码如下。 package com.wsy.boot.activemq.config; import org.apache.activemq.command.ActiveMQTopic; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.jms.annotation.EnableJms; import org.springframework.stereotype