ActiveMq在springboot中的应用

本文介绍了如何在SpringBoot项目中配置并使用ActiveMq作为消息中间件,包括基础配置如URL、用户名、密码,以及连接池设置。此外,还提到了集群配置选项和如何确保同时兼容队列和主题消息的处理。文中详细展示了生产者和消费者的实现。
摘要由CSDN通过智能技术生成

springboot使用的版本是

       <groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>1.5.9.RELEASE</version>
		springboot和activemq的启动包也是1.5.9版本
       <dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-activemq</artifactId>
			<version>1.5.9.RELEASE</version>
		</dependency>
		activemq的包注意要使用5.14以下的包,以上的不兼容队列和主题模式的同时在应用中存在
        <dependency>
			<groupId>org.apache.activemq</groupId>
			<artifactId>activemq-all</artifactId>
			<version>5.13.3</version>
		</dependency>

基础配置
spring.activemq.broker-url=tcp://127.0.0.1:61616
spring.activemq.user=admin
spring.activemq.password= admin
spring.activemq.pool.enabled= false
#集群配置
#spring.activemq.broker-url=failover:(tcp://172

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值