activemq

谁才是最快的消息队列:ActiveMQ, RabbitMQ, HornetQ, QPID...

橙三吉。 提交于 2019-12-10 15:52:35
Lately I performed a message queue benchmark , comparing several queuing frameworks (RabbitMQ, ActiveMQ…). Those benchmarks are part of a complete study conducted by Adina Mihailescu , and everything was presented at the April 2013 riviera.rb meet-up . You should definitely peek into Adina’s great presentation available online right here . Setup and scenarios So I wanted to benchmark brokers, using different protocols: I decided to build a little Rails application piloting a binary that was able to enqueue/dequeue items taken from a MySQL database . I considered the following scenarios:

【消息队列】ActiveMQ知识点

送分小仙女□ 提交于 2019-12-10 15:29:57
1. 什么是ActiveMQ ActiveMQ 是Apache出品,最流行的,能力强劲的开源消息总线。ActiveMQ 是一个完全支持JMS1.1和J2EE 1.4规范的 JMS Provider实现,尽管JMS规范出台已经是很久的事情了,但是JMS在当今的J2EE应用中间仍然扮演着特殊的地位 2.消息队列应用场景 以下介绍消息队列在实际应用中常用的使用场景。 异步处理 , 应用解耦 , 流量削锋 和 消息通讯 四个场景 2.1 异步处理 场景说明:用户注册后,需要发注册邮件和注册短信。传统的做法有两种: 1.串行方式;2.并行方式 (1)串行方式:将注册信息写入 数据库 成功后,发送注册邮件,再发送注册短信。以上三个任务全部完成后,返回给客户端 2)并行方式:将注册信息写入数据库成功后,发送注册邮件的同时,发送注册短信。以上三个任务完成后,返回给客户端。与串行的差别是,并行的方式可以提高处理的时间 假设三个业务节点每个使用50毫秒钟,不考虑网络等其他开销,则串行方式的时间是150毫秒,并行的时间可能是100毫秒。 因为CPU在单位时间内处理的请求数是一定的,假设CPU在1秒内吞吐量是100次。则串行方式1秒内CPU可处理的请求量是7次(1000/150)。并行方式处理的请求量是10次(1000/100) 小结:如以上案例描述,传统的方式系统的性能(并发量,吞吐量,响应时间

DefaultMessageListenerContainer not receiving messages

青春壹個敷衍的年華 提交于 2019-12-10 15:09:59
问题 I have a DefaultMessageListenerContainer configured as follows: DefaultMessageListenerContainer container = new DefaultMessageListenerContainer(); container.setConcurrentConsumers(4); container.setConnectionFactory(connectionFactory); container.setDestinationName(String.format("Consumer.%s.VirtualTopic.%s", group, topic)); container.setSessionAcknowledgeMode(Session.CLIENT_ACKNOWLEDGE); container.setSessionTransacted(true); container.setMessageListener(new DelegatingMessageListener(listener,

Virtual topics/queues and durability

做~自己de王妃 提交于 2019-12-10 14:58:23
问题 What will happen to messages posted to a virtual topic when there are no consumers listening ? Will the broker hold them for a certain while until a subscriber is available ? More specifically : At T0 and T1 messages M0 and M1 are posted. At T2, consumer C1 connects, will he receive M0 and M1 ? Obviously messages M2 and M3 posted at T3 and T4 will be received by C1, but what will a new Consumer, C2, that connects at T5 receice ? All messages, M2 and M3, or none ? 回答1: It depends on the nature

Enforce socket timeout on ActiveMQ from Camel route?

為{幸葍}努か 提交于 2019-12-10 13:58:32
问题 So below I have Camel (via Spring DSL) successfully integrating my beans with ActiveMQ queues: <!-- Note: this code is just a snippet; if you need to see more, please let me know! --> <camelContext id="my-camel-context" xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="activemq-myinstance:queue:myqueue" /> <onException> <exception>java.lang.Exception</exception> <redeliveryPolicy maximumRedeliveries="2" /> <to uri="activemq-myinstance:queue_failures" /> </onException> <to uri=

How do I turn on JMX in ActiveMQ 5.2

社会主义新天地 提交于 2019-12-10 13:57:43
问题 Whats the proper way to enable JMX in ActiveMQ 5.2? I've seen conflicting documents, so I was wondering if anyone out there knows what the proper config file change should be. I think I might have it working by changing the batch file I use to start ActiveMQ, but I don't really know. 回答1: <!-- Use the following to configure how ActiveMQ is exposed in JMX --> <managementContext> <managementContext createConnector="true" /> </managementContext> Put this inside the bean of your broker in the

ActiveMQ的安装与配置

北慕城南 提交于 2019-12-10 13:20:04
官网:    http://activemq.apache.org/ 1. 下载或上传:   上传到/opt目录下面; 上传:put F:\BaiduNetdiskDownload\apache-activemq-5.15.10-bin.tar下载:http://activemq.apache.org/components/classic/download移动:mv apache-activemq-5.15.10-bin.tar.gz /opt/ 2. 解压缩: cd /opt/tar -xzvf apache-activemq-5.15.10-bin.tar.gz -C /usr/local/cd /usr/local/mv apache-activemq-5.15.10/ activemq 3. 启动与关闭:   检查是否安装JDK:java -version cd /usr/local/activemq/bin/ ./activemq start ./activemq stop ./activemq restart ./activemq start > /myactivemq/myrunmq.log 带日志启动 4. 查看启动:   activemq的默认进程端口是:61616 ps -ef|grep activemqps -ef|grep activemq|grep -v

JMS and ThreadPool problem?

我只是一个虾纸丫 提交于 2019-12-10 12:05:17
问题 I want that jms receives a message when one thread has handled a message (threadPool submits a callable). The messages are received by a master thread. Which way is better below: I use spring 3.0.5 : ApplicationContext context = new ClassPathXmlApplicationContext( "application-context.xml"); jmsTemplate = (JmsTemplate) context.getBean("jmsTemplate"); destination = (Destination) context.getBean("destination"); _log4j.debug("ThreadSize in xml\t" + appConfig.getThumbCreatorThreadSize()); in

gradle+springBoot2.2集合ActiveMq

被刻印的时光 ゝ 提交于 2019-12-10 11:57:47
springBoot集成AcitiveMq的时候,由于springBoot的版本不同,所有会出现不同的问题。 当我们在启动连接池的时候有的时候会出现:启动项目会报错,提示JmsMessagingTemplate无法注入、 这个时候,你可以参考: https://blog.csdn.net/eumenides_/article/details/91850332 可能是你引入jar包的问题。 我们以springBoot2.2为例 第一步:引入jar包。 compile('org.springframework.boot:spring-boot-starter-activemq') compile group: 'org.messaginghub', name: 'pooled-jms', version: '1.1.0' 在这个地方一定要切记: 不能再引入springBoot的时候,把geronimo的包去除了。因为ActiveMq需要这个包。下面的要注解掉。 config.exclude group: "org.apache.geronimo.specs" config.exclude group: "com.google.code.findbugs" 第二步:在代码中引用mq 在启动类里添加: @EnableJms 所以接下来,在需要的controller层,引入redis /**

Using an expression in a JMS Selector in Mule 3

♀尐吖头ヾ 提交于 2019-12-10 11:55:45
问题 I want to get a queue: <jms:inbound-endpoint connector-ref="jmsConnector" queue="queue.dev" > <jms:selector expression="JMSCorrelationID='353'"/> </jms:inbound-endpoint> It works but I want to use an expression in the selector: <jms:inbound-endpoint connector-ref="jmsConnector" queue="queue.dev" > <jms:selector expression="JMSCorrelationID='#[header:OUTBOUND:codeReport]'"/> </jms:inbound-endpoint> It's no working. 回答1: This doesn't make sense: you are trying to use an outbound property in an