activemq

SpringBoot整合ActiveMQ(消息中间件)实现邮件发送功能

元气小坏坏 提交于 2020-01-29 06:43:47
1.ActiveMQ是什么鬼? ActiveMQ是一种开源的基于JMS(Java Message Servie)规范的一种消息中间件的实现,ActiveMQ的设计目标是提供标准的,面向消息的,能够跨越多语言和多系统的应用集成消息通信中间件。ActiveMQ常被应用与系统业务的解耦,异步消息的推送,增加系统并发量,提高用户体验。 a.AcitveMQ的数据传送流程 b.ActiveMQ的两种消息传递类型 (1)点对点传输,即一个生产者对应一个消费者,生产者向broke推送数据,数据存储在broke的一个队列中,然后消费者接受该条队列里的数据。 (2)基于发布/订阅模式的传输,即根据订阅话题来接收相应数据,一个生产者可向多个消费者推送数据。两种消息传递类型的不同,点对点传输消费者可以接收到在连接之前生产者所推送的数据,而基于发布/订阅模式的传输方式消费者只能接收到连接之后生产者推送的数据 2.代码实现(注意:本地需先安装 ActiveMQ ) (1)构建maven项目,pom文件中引入依赖: (2)application.yml文件内容配置: 这里是mq和mail的配置,需要注意不要有重复配置,我刚开始配置了两个spring导致mail配置没有生效,项目启动时总是报无法自动注解!!! (3)Email实体类的创建: (4)创建生产者: (5)创建消费者(监听器):

使用java连接activemq简单发送实例报错javax.jms.JMSException: Disposed due to prior exception

本小妞迷上赌 提交于 2020-01-28 16:07:07
原因:之前使用的是 public static final String ACTIVEMQ_URL = "tcp://192.168.3.25:8161"; 这个url 后来改为 public static final String ACTIVEMQ_URL = "tcp://192.168.3.25:61616"; 就成功不报错了 来源: CSDN 作者: HenryJackey 链接: https://blog.csdn.net/qq_27247211/article/details/103834376

ActiveMQ bad certificate when introduce SSL

不羁岁月 提交于 2020-01-25 10:10:08
问题 I am trying to use openwire+ssl in my ActiveMq. I am using the docker images provided by rmohr/activemq. What I ran the following commands to generated necessary files since the broker_localhost.cert has expired. keytool -genkey -alias broker -keyalg RSA -keystore broker.ks keytool -export -alias broker -keystore broker.ks -file broker_cert keytool -genkey -alias client -keyalg RSA -keystore client.ks keytool -import -alias broker -keystore client.ts -file broker_cert keytool -export -alias

ActiveMQ与Spring整合

无人久伴 提交于 2020-01-25 09:17:25
与Spring整合开发的话,非常方便。 1. pom.xml < project xmlns= "http://maven.apache.org/POM/4.0.0" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" > < modelVersion >4.0.0 </ modelVersion > < groupId >org.ygy </ groupId > < artifactId >activemq </ artifactId > < version >0.0.1-SNAPSHOT </ version > < packaging >jar </ packaging > < name >activemq </ name > < url >http://maven.apache.org </ url > < properties > < project.build.sourceEncoding >UTF-8 </ project.build.sourceEncoding > < spring.version >3.1.1

SpringBoot学习笔记(11)-----SpringBoot中使用rabbitmq,activemq消息队列和rest服务的调用

时光怂恿深爱的人放手 提交于 2020-01-25 09:16:21
1. activemq   首先引入依赖   pom.xml文件 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-activemq</artifactId> </dependency>   创建一个配置队列类   JMSConfiguration.java package com.wangx.boot.util; import org.apache.activemq.command.ActiveMQQueue; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.jms.annotation.EnableJms; import javax.jms.Destination; @Configuration @EnableJms public class JMSConfiguration { @Bean public Destination createDestination () { return new ActiveMQQueue(

ActiveMq and mosquitto bridge not working

徘徊边缘 提交于 2020-01-25 04:05:11
问题 I am getting below error on activemq console when i am trying to connect from mosquitto to activemq. WARN | Transport Connection to: tcp://192.168.0.27:48689 failed: java.io.IOException: Unknown data type: 77 MY setup is as below 192.168.0.27 ---- Mosquitto broker with below configuration for bridge connection try try_private false address 192.168.0.22:61616 username myuser password mypassword start_type automatic clientid 1 notifications true topic inbound/# in alpha/ beta/ topic outbound/#

关于ActiveMQ、RocketMQ、RabbitMQ、Kafka的区别

二次信任 提交于 2020-01-24 15:02:16
综合上面的材料得出以下两点: (1)中小型软件公司,建议选RabbitMQ.一方面,erlang语言天生具备高并发的特性,而且他的管理界面用起来十分方便。正所谓,成也萧何,败也萧何!他的弊端也在这里,虽然RabbitMQ是开源的,然而国内有几个能定制化开发erlang的程序员呢?所幸,RabbitMQ的社区十分活跃,可以解决开发过程中遇到的bug,这点对于中小型公司来说十分重要。不考虑rocketmq和kafka的原因是,一方面中小型软件公司不如互联网公司,数据量没那么大,选消息中间件,应首选功能比较完备的,所以kafka排除。不考虑rocketmq的原因是,rocketmq是阿里出品,如果阿里放弃维护rocketmq,中小型公司一般抽不出人来进行rocketmq的定制化开发,因此不推荐。 (2)大型软件公司,根据具体使用在rocketMq和kafka之间二选一。一方面,大型软件公司,具备足够的资金搭建分布式环境,也具备足够大的数据量。针对rocketMQ,大型软件公司也可以抽出人手对rocketMQ进行定制化开发,毕竟国内有能力改JAVA源码的人,还是相当多的。至于kafka,根据业务场景选择,如果有日志采集功能,肯定是首选kafka了。具体该选哪个,看使用场景。 使用场景: 在我们的电商中,在发送短信和商品上下架的时候使用了rebbitMQ 来源: CSDN 作者:

ActiveMQ memory consumption through the roof (page file)… what to do?

僤鯓⒐⒋嵵緔 提交于 2020-01-24 12:13:21
问题 We're using an older version of ActiveMQ (5.3.2) (see: Is activemq reliable?) We've removed persistence because we needed more speed. Our worker can keep up with the messages, but, even though the queue typically is at 0 pending, after about 45000 messages processed (a message is typically 100 chars long), the Page file is 8GB!! It doesn't stop there though, it continues until 15 GB is reached (Our server has 16gb memory)! Stopping the ActiveMQ process doesn't clean up this pagefile, it

ActiveMQ memory consumption through the roof (page file)… what to do?

北城余情 提交于 2020-01-24 12:12:08
问题 We're using an older version of ActiveMQ (5.3.2) (see: Is activemq reliable?) We've removed persistence because we needed more speed. Our worker can keep up with the messages, but, even though the queue typically is at 0 pending, after about 45000 messages processed (a message is typically 100 chars long), the Page file is 8GB!! It doesn't stop there though, it continues until 15 GB is reached (Our server has 16gb memory)! Stopping the ActiveMQ process doesn't clean up this pagefile, it

Why am I recieving a JMSBytesMessage when I'm sending an OBject message using Spring and MQ Queue

倾然丶 夕夏残阳落幕 提交于 2020-01-24 09:26:41
问题 So I'm sending an object using Spring and IBM MQ Queue: public void sendObjectMessage(final Object message) { // jmsTemplate.convertAndSend(message); jmsTemplate.send(new MessageCreator() { public Message createMessage(Session session) throws JMSException { ObjectMessage outMessage = session.createObjectMessage((Serializable) message); return(outMessage); } }); } And during debugging I can see that I am indeed sending it as an object message. But using Spring's listener implementation I am