activemq

Redis 与 MQ 的区别

最后都变了- 提交于 2019-11-29 22:15:37
  Redis是一个高性能的key-value数据库,它的出现很大程度补偿了memcached这类key-value存储的不足。虽然它是一个数据库系统,但本身支持MQ功能,完全可以当做一个轻量级的队列服务器使用。   不过,Redis只是提供一个高性能的、原子操作内存键值队,具有高速访问能力,虽可用做消息队列的存储,但是不具备消息队列的任何功能和逻辑,要作做为消息队列来实现的话,功能和逻辑要通过上层应用自己实现。 Redis从2.0版本开始支持发布/订阅指令,发布者调用redis的publish方法往特定的channel发送消息,订阅者在初始化的时候要订阅到该channel,一旦有消息就会立即接收。 Redis 消息推送(基于分布式 pub/sub)多用于实时性较高的消息推送,并不保证可靠。 其他的mq和kafka保证可靠但有一些延迟(非实时系统没有保证延迟)。redis-pub/sub断电就清空,而使用redis-list作为消息推送虽然有持久化,但是也并非完全可靠不会丢。 另外一点,redis 发布订阅除了表示不同的 topic 外,并不支持分组。 比如,kafka中发布一个东西,多个订阅者可以分组,同一个组里只有一个订阅者会收到该消息,这样可以用作负载均衡。 性能上,对于RabbitMQ和Redis的入队和出队操作,各执行100万次,每10万次记录一次执行时间

ActiveMQ: How to handle broker failovers while using temporary queues

末鹿安然 提交于 2019-11-29 20:24:29
On my JMS applications we use temporary queues on Producers to be able to receive replies back from Consumer applications. I am facing exactly same issue on my end as mentioned in this thread: http://activemq.2283324.n4.nabble.com/jira-Created-AMQ-3336-Temporary-Destination-errors-on-H-A-failover-in-broker-network-with-Failover-tt-td3551034.html#a3612738 Whenever I restarted an arbitrary broker in my network, I was getting many errors like this in my Consumer application log while trying to send reply to a temporary queue: javax.jms.InvalidDestinationException: Cannot publish to a deleted

Java Messaging : Difference between ActiveMQ, Mule, ServiceMix and Camel

吃可爱长大的小学妹 提交于 2019-11-29 18:59:42
I am new to Messaging and want to know the difference between ActiveMQ , Mule , ServiceMix and Camel Anyone knows how each of these product is different? Thanks in advance ! EDIT: Also would like to know any good place/resource to learn these things. duffymo ActiveMQ is a message broker which implements the JMS API and supports a number of cross language clients and network protocols . It lets you implement queues or topics and write listeners or subscribers to respond to queue events. Mule and ServiceMix are open source ESB (enterprise service bus). An ESB has capabilities beyond JMS: queuing

ActiveMQ configuration with Spring Boot

人盡茶涼 提交于 2019-11-29 18:38:30
问题 I use ActiveMQ as Embedded with Spring Boot. It seems the Broker is created trough an ActiveMQConnectionFactory. I understand that the way to configure the broker is to set parameters in the query with broker. as described here : http://activemq.apache.org/how-do-i-embed-a-broker-inside-a-connection.html I would like to setup some features about the DLQ, so it's in the destinationPolicy attribute, but the attribute type is not a simple type but a complex type, how can I write the query

ActiveMQ高可用集群方案

此生再无相见时 提交于 2019-11-29 18:29:42
一. ActiveMQ的高可用原理 使用ZooKeeper(集群)注册所有的ActiveMQ Broker。只有其中的一个Broker可以提供服务,被视为 Master,其他的 Broker 处于待机状态,被视为Slave。如果Master因故障而不能提供服务,Zookeeper会从Slave中选举出一个Broker充当Master。 Slave连接Master并同步他们的存储状态,Slave不接受客户端连接。所有的存储操作都将被复制到 连接至 Master的Slaves。如果Master宕了,得到了最新更新的Slave会成为 Master。故障节点在恢复后会重新加入到集群中并连接Master进入Slave模式。 是不是觉得和Redis Sentinel主从高可用的方式很像,这里的zookeeper起到的作用和reids里的sentinel作用差不多。 另外,附上官方文档的一则警告,请使用者注意。replicated LevelDB 不支持延迟或者计划任务消息。这 些消息存储在另外的LevelDB文件中,如果使用延迟或者计划任务消息,将不会复制到Slave Broker上,不能实现消息的高可用。 二. ActiveMQ的持久化方式 ActiveMQ有三种持久化方式(在activemq.xml可配): (1) 基于共享文件系统(KahaDB,默认)

Multithreaded JMS client ActiveMQ

蹲街弑〆低调 提交于 2019-11-29 17:41:24
I am using the below code to create multiple JMS sessions for multiple consumers to consume messages. My problem is that the code is running in a single threaded fashion. Even if messages are present in the Queue the Second thread is unable to receive anything and just keeps polling. The first thread meanwhile finishes processing the first batch and comes back and consumes the remaining messages. Is there anything wrong with the usage here ? static { try { ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://172.16.143.99:61616"); connection = connectionFactory

ActiveMQ + NodeJS + Stomp 极简入门

穿精又带淫゛_ 提交于 2019-11-29 17:03:52
前提 安装ActiveMQ和Nodejs 测试步骤 1.执行bin\win32\activemq.bat启动MQ服务 2. 打开http://localhost:8161/admin/topics.jsp 用户名和密码都是 admin 3. 下载Stomp npm install stomp-client 4. js的测试代码 var Stomp = require('stomp-client'); var destination = '/topic/myTopic'; var client = new Stomp('127.0.0.1', 61613, 'user', 'pass'); client.connect(function(sessionId) { client.subscribe(destination, function(body, headers) { console.log('From MQ:', body); }); client.publish(destination, 'Hello World!'); }); 在NodeJS中执行 5. 打开http://localhost:8161/admin/send.jsp?JMSDestination=myTopic&JMSDestinationType=topic 就可以看到从NodeJs发来的消息 6

ActiveMQ + NodeJS + Stomp 极简入门

三世轮回 提交于 2019-11-29 17:02:47
前提 安装ActiveMQ和Nodejs 测试步骤 1.执行bin\win32\activemq.bat启动MQ服务 2. 打开http://localhost:8161/admin/topics.jsp 用户名和密码都是 admin 3. 下载Stomp npm install stomp-client 4. js的测试代码 var Stomp = require('stomp-client'); var destination = '/topic/myTopic'; var client = new Stomp('127.0.0.1', 61613, 'user', 'pass'); client.connect(function(sessionId) { client.subscribe(destination, function(body, headers) { console.log('From MQ:', body); }); client.publish(destination, 'Hello World!'); }); 在NodeJS中执行 5. 打开http://localhost:8161/admin/send.jsp?JMSDestination=myTopic&JMSDestinationType=topic 就可以看到从NodeJs发来的消息 6

ActiveMQ + NodeJS + Stomp 极简入门

ε祈祈猫儿з 提交于 2019-11-29 17:02:35
前提 安装ActiveMQ和Nodejs 測试步骤 1.运行bin\win32\activemq.bat启动MQ服务 2. 打开http://localhost:8161/admin/topics.jsp username和password都是 admin 3. 下载Stomp npm install stomp-client 4. js的測试代码 var Stomp = require('stomp-client'); var destination = '/topic/myTopic'; var client = new Stomp('127.0.0.1', 61613, 'user', 'pass'); client.connect(function(sessionId) { client.subscribe(destination, function(body, headers) { console.log('From MQ:', body); }); client.publish(destination, 'Hello World!'); }); 在NodeJS中运行 5. 打开http://localhost:8161/admin/send.jsp?JMSDestination=myTopic&JMSDestinationType=topic

ActiveMQ + NodeJS + Stomp 入门

风格不统一 提交于 2019-11-29 17:02:27
NodeJS + stomp-client 入门 准备 下载 ActiveMQ 并安装 执行bin\win32\activemq.bat启动MQ服务 打开http://localhost:8161/admin/topics.jsp,其中用户名和密码都是 admin npm安装 stomp-client npm install stomp-client --save 编写测试demo demo.js var Stomp = require('stomp-client'); var destination = '/topic/myTopic'; var client = new Stomp('127.0.0.1', 61613, 'user', 'pass'); client.connect(function(sessionId) { client.subscribe(destination, function(body, headers) { console.log('This is the body of a message on the subscribed queue:', body); }); client.publish(destination, 'Jason Li'); }); 运行代码 node demo.js 打开http://localhost:8161/admin