activemq

SpringBoot整合ActiveMQ,看这篇就够了

匿名 (未验证) 提交于 2019-12-02 21:52:03
ActiveMQ是Apache提供的一个开源的消息系统,完全采用Java来实现,因此它能很好地支持JMS(Java Message Service,即Java消息服务)规范;本文将详细介绍下ActiveMq的安装、与SpringBoot整合发送队列消息、发送主题消息的的过程。 本文目录 一、Linux下ActiveMQ安装 1.下载并解压 2.运行 3.进入管理界面 二、发送队列消息 三、发送主题消息 一、Linux下ActiveMQ安装 1.下载并解压 wget https : //mirrors.tuna.tsinghua.edu.cn/apache//activemq/5.15.9/apache-activemq-5.15.9-bin.tar.gztar zxvf apache-activemq-5.15.9-bin.tar.gz 2.运行 cd bin /./ activemq start 3.进入管理界面 浏览器访问192.168.0.1:8161/admin/,默认用户名和密码为:admin/admin,控制台截图如下: 列表中信息含义如下: Number Of Pending Messages:等待消费的消息 这个是当前未出队列的数量。 Number Of Consumers:消费者 这个是消费者端的消费者数量 Messages Enqueued:进入队列的消息

ActiveMQ常见错误三:Caused by: java.net.UnknownHostException: centos: 未知的名称或服务

匿名 (未验证) 提交于 2019-12-02 21:40:30
ActiveMQ启动时出现错误信息如下: Caused by: java.net.UnknownHostException: centos: 未知的名称或服务 at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:866) at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1258) at java.net.InetAddress.getLocalHost(InetAddress.java:1434) 问题分析: 根据日志java.net.UnknownHostException: localhost判断,应该是由于服务器无法正确解析localhost造成的 [plain] view plain copy 根据日志Error creating bean with name 'org.apache.activemq.xbean.XBeanBrokerService' defined in class path resource [activemq.xml]判断,应该是activemq

Spring整合ActiveMq消息队列

匿名 (未验证) 提交于 2019-12-02 21:35:04
ActiveMQ 是Apache出品,最流行的,能力强劲的开源消息总线。ActiveMQ 是一个完全支持JMS1.1和J2EE 1.4规范的 JMS Provider实现,尽管JMS规范出台已经是很久的事情了,但是JMS在当今的J2EE应用中间仍然扮演着特殊的地位。 特性列表: ⒈ 多种语言和协议编写客户端。语言: Java,C,C++,C#,Ruby,Perl,Python,PHP。应用协议: OpenWire,Stomp REST,WS Notification,XMPP,AMQP ⒉ 完全支持JMS1.1和J2EE 1.4规范 (持久化,XA消息,事务) ⒊ 对spring的支持,ActiveMQ可以很容易内嵌到使用Spring的系统里面去,而且也支持Spring2.0的特性 ⒋ 通过了常见J2EE服务器(如 Geronimo,JBoss 4,GlassFish,WebLogic)的测试,其中通过JCA 1.5 resource adaptors的配置,可以让ActiveMQ可以自动的部署到任何兼容J2EE 1.4 商业服务器上 ⒌ 支持多种传送协议:in-VM,TCP,SSL,NIO,UDP,JGroups,JXTA ⒍ 支持通过JDBC和journal提供高速的消息持久化 ⒎ 从设计上保证了高性能的集群,客户端-服务器,点对点 ⒏ 支持Ajax ⒐ 支持与Axis的整合

springboot 学习笔记(六)

匿名 (未验证) 提交于 2019-12-02 20:59:24
(六)springboot整合activemq    1、现下载activemq,下载链接:http://activemq.apache.org/download.html,windows系统解压后进入bin目录,分32位、64位操作系统,运行activemq.bat启动程序,访问http://http://127.0.0.1:8161 点击queue按钮,可以创建消息队列。   2、pom文件中增加以下依赖,在application.properties对activema进行配置 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-activemq</artifactId> </dependency> <dependency> <groupId>org.apache.activemq</groupId> <artifactId>activemq-pool</artifactId> </dependency> #访问地址 spring.activemq.broker-url=tcp://127.0.0.1:61616 spring.activemq.user=admin spring.activemq.password=admin #是否开启线程池

Which embedded messaging system -> ActiveMQ or HornetQ

喜欢而已 提交于 2019-12-02 17:27:56
I would appreciate some general pointers and opinions regarding which of the two messaging systems is easier to manage has less gotchas or magic stuff one needs to know and avoid has less overal dependencies is simple to work with. Clebert Suconic easier to manage hornetQ has a clear API for management and it's very easy to use. has less gotchas or magic stuff one needs to know and avoid hornetQ was made for the embedded case. It is very, very easy to integrate it in your code. As a matter of fact you can do it with less than 10 lines of code. has less overall dependencies Everything on

MongoDB Schema Design - Real-time Chat

那年仲夏 提交于 2019-12-02 17:18:00
I'm starting a project which I think will be particularly suited to MongoDB due to the speed and scalability it affords. The module I'm currently interested in is to do with real-time chat. If I was to do this in a traditional RDBMS I'd split it out into: Channel (A channel has many users) User (A user has one channel but many messages) Message (A message has a user) The the purpose of this use case, I'd like to assume that there will be typically 5 channels active at one time, each handling at most 5 messages per second. Specific queries that need to be fast: Fetch new messages (based on an

What is an MQ and why do I want to use it?

自闭症网瘾萝莉.ら 提交于 2019-12-02 17:16:59
On my team at work, we use the IBM MQ technology a lot for cross-application communication. I've seen lately on Hacker News and other places about other MQ technologies like RabbitMQ . I have a basic understanding of what it is (a commonly checked area to put and get messages), but what I want to know what exactly is it good at? How will I know where I want to use it and when? Why not just stick with more rudimentary forms of interprocess messaging? All the explanations so far are accurate and to the point - but might be missing something: one of the main benefits of message queueing:

Unable to access ActiveMQ using JMS based code and amqp 1.0

梦想与她 提交于 2019-12-02 17:16:47
问题 I'm trying to connect to an ActiveMQ broker using AMQP 1.0, but I want to use JMS within my application code. I'm interested in using JMS primarily because I want developers to be able to use API's that they are already familiar with. I have ActiveMQ 5.14.0 running on localhost and the following code : public static void main(String[] args) throws JMSException, InterruptedException { Connection connection = null; try { // Producer ConnectionFactory connectionFactory = new

ActiveMQ:No operations allowed after statement ...

大兔子大兔子 提交于 2019-12-02 15:53:27
ActiveMQ版本:5.5.1 记录人:@郑昀 现象: 系统现象:部分消息发送失败,失败频率不正常。 日志信息:activemq.log 中一直有这样的错误日志: JDBC Failure : No operations allowed after statement closed . com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after statement closed. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) ………… at org.apache.activemq.transport. InactivityMonitor .onCommand(InactivityMonitor.java:227) at org.apache.activemq.transport.TransportSupport.doConsume

消息队列中间件Celery、RabbitMQ

China☆狼群 提交于 2019-12-02 14:29:43
消息队列中间件(简称消息中间件)是指利用高效可靠的消息传递机制进行与平台无关的数据交流,并基于数据通信来进行分布式系统的集成。通过提供消息传递和消息排队模型,它可以在分布式环境下提供应用解耦、弹性伸缩、冗余存储、流量削峰、异步通信、数据同步等等功能,其作为分布式系统架构中的一个重要组件,有着举足轻重的地位。 目前开源的消息中间件可谓是琳琅满目,能让大家耳熟能详的就有很多,比如ActiveMQ、RabbitMQ、Kafka、RocketMQ(阿里)、ZeroMQ等。不管选择其中的哪一款,都会有用的不趁手的地方,毕竟不是为你量身定制的。有些大厂在长期的使用过程中积累了一定的经验,其消息队列的使用场景也相对稳定固化,或者目前市面上的消息中间件无法满足自身需求,并且也具备足够的精力和人力而选择自研来为自己量身打造一款消息中间件。但是绝大多数公司还是不会选择重复造轮子,那么选择一款合适自己的消息中间件显得尤为重要。就算是前者,那么在自研出稳定且可靠的相关产品之前还是会经历这样一个选型过程。 消息队列是消息在传输的过程中保存消息的容器。 celery:流程图: <ignore_js_op> RabbitMQ AMQP,即Advanced Message Queuing Protocol,高级消息队列协议,是应用层协议的一个开放标准,为面向消息的 中间件 设计。消息中间件主要用于组件之间的解耦