activemq

How to configure embedded ActiveMQ Broker URL with Spring Boot

对着背影说爱祢 提交于 2019-12-04 03:16:10
I followed a simple example of setting up and running embedded ActiveMQ with Spring Boot (version 1.4.X). Here's link to the example https://spring.io/guides/gs/messaging-jms/ My class is structured as below: @SpringBootApplication @EnableJms public class Application { @Autowired ConfigurableApplicationContext context; @Bean JmsListenerContainerFactory<?> myJmsContainerFactory(ConnectionFactory connectionFactory) { SimpleJmsListenerContainerFactory factory = new SimpleJmsListenerContainerFactory(); factory.setConnectionFactory(connectionFactory); return factory; } @JmsListener(destination =

Ubuntu下安装ActiveMQ

被刻印的时光 ゝ 提交于 2019-12-04 01:37:17
主要参考 http://www.jmkg.co.uk/2010/08/31/installing -activemq-on-ubuntu/ ,略有补充 1. 下载安装包,建立activemq用户,安装 下载最新的activemq,写此文时为5.7。 cd /opt/ tar xvzf xxxx/apache-activemq-5.7.0.tar.gz ln -s apache-activemq-5.7.0 activemq adduser activemq chown -R activemq.activemq apache-activemq-5.7.0 ln -sf /opt/activemq/bin/activemq /etc/init.d/ update-rc.d activemq defaults 2. 生成并编辑配置文件 /etc/init.d/activemq setup /etc/default/activemq 这里面主要有3项需要定制配置: ACTIVEMQ_USER,运行activemq的用户,配置为刚才建立的activemq用户 ACTIVEMQ_DATA,activemq的data路径,存放真正的队列数据等,可以直接加在配置文件开头,目录权限需要为ACTIVEMQ_USER可写 JMX配置,这一项比较麻烦一点,主要是管理activemq的jmx连接配置

ActiveMQ - delete/purge all queue via command line

不羁岁月 提交于 2019-12-04 01:23:56
Is there a way to delete / purge all queues in ActiveMQ via the command line (win/linux)? I could only find the commands for a specific queue. Or maybe there's a way to do this via the activeMQ admin? Again, I only found how to delete/purge the queues one by one, which can be very tedious. Thanks! You can do tweak your activemq.xml a bit: <broker deleteAllMessagesOnStartup="true" ...> This works with KahaDB message stores (it has problems with JDBC message stores), all your messages get deleted and subsequently queues are cleared. As you want all queues to be deleted, restarting the broker won

Unit testing with JMS (ActiveMQ)

痞子三分冷 提交于 2019-12-04 00:30:59
How to do unit testing with JMS ? Is it some de-facto for this ? I googled something - Unit testing for JMS: http://activemq.apache.org/how-to-unit-test-jms-code.html - jmsTemplate: activemq.apache.org/jmstemplate-gotchas.html - mockRunner : mockrunner.sourceforge.net/ Do you have any good experience on those and suggestion for me ? In my experience (after trying to do the same thing) when you are using JMS you are doing something like 1) Get JMS Message 2) Extract Object from Message 3) Do something with Object From that point of view I would suggest you unit test #3 but don't bother unit

JMS message priority not working on Message

僤鯓⒐⒋嵵緔 提交于 2019-12-03 23:30:14
I need to set message priority so that High priority messages are consumed before Low priority messages by Receivers. First I tried with message.setJMSPriority() method to set the priority but it was not working in HornetQ and ActiveMQ so finally I set the priority of the Message Producer using setPriority() method and it works fine now. Why isn't Messsge.setJMSPriority() working in any of the JMS vendor implementations and why do we need to set the priority of the Producer not the message itself to set the priority of the message? What is the use of Messsge.setJMSPriority() method then? Any

ActiveMQ 学习笔记系列

淺唱寂寞╮ 提交于 2019-12-03 22:44:17
ActiveMQ学习笔记(1)——JMS的概念 ActiveMQ学习笔记(2)——JMS消息模型 ActiveMQ学习笔记(3)——ActiveMQ的安装 ActiveMQ学习笔记(4)——通过ActiveMQ收发消息 ActiveMQ学习笔记(5)——使用Spring JMS收发消息 ActiveMQ学习笔记(6)——JMS消息类型 ActiveMQ学习笔记(7)——ActiveMQ Master Slave集群配置 ActiveMQ学习笔记(8)——导入ActiveMQ源码到Eclipse ActiveMQ学习笔记(9)-Broker Cluster ActiveMQ学习笔记(10)-镜像队列 来源: oschina 链接: https://my.oschina.net/u/1024408/blog/632191

Activemq java.net.BindException: Address already.

混江龙づ霸主 提交于 2019-12-03 19:51:56
错误堆栈信息如下: 2014-04-24 13:53:22,911 | INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@3ef810: startup date [Thu Apr 24 13:53:22 CST 2014]; root of context hierarchy | org.apache.activemq.xbean.XBeanBrokerFactory$1 | main 2014-04-24 13:53:23,832 | INFO | PListStore:[F:\tools\Apache\activemq\apache-activemq-5.7.0\bin\..\data\localhost\tmp_storage] started | org.apache.activemq.store.kahadb.plist.PListStore | main 2014-04-24 13:53:23,878 | INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[F:\tools\Apache\activemq\apache-activemq-5.7.0\bin\..\data\kahadb] | org.apache

activemq服务无法正常启动

我是研究僧i 提交于 2019-12-03 19:51:45
2012-09-26 13:26:41,092 | INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@1a7e798 : startup date [Wed Sep 26 13:26:41 CST 2012]; root of context hierarchy | org.apache.activemq.xbean.XBeanBrokerFactory$1 | main 2012-09-26 13:26:42,162 | INFO | PListStore:[D:\apache-activemq-5.6.0-bin\apache-activemq-5.6.0\bin\..\data\localhost\tmp_storage ] started | org.apache.activemq.store.kahadb.plist.PListStore | main 2012-09-26 13:26:42,187 | INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[D:\apache-activemq-5.6.0-bin\apache-activemq-5.6.0\bin\..\data\kahadb] | org.apache

Zabbix监控ActiveMQ

会有一股神秘感。 提交于 2019-12-03 19:51:31
当我们在线上使用了ActiveMQ 后,我们需要对一些参数进行监控,比如 消息是否有阻塞,哪个消息队列阻塞了,总的消息数是多少等等。下面我们就通过 Zabbix 结合 Python 脚本来实现对 ActiveMQ的监控。 一、创建 Activemq Python 监控脚本 因为 CentOS 系统默认安装的是 Python2.7,为了避免麻烦,我们这里的脚本也是对应的 Python2 Python2 监控脚本 # -*- coding: utf-8 -*- # @Time : 2019/6/25 9:26 # @Author : djx # @Email : djxlsp@163.com # @File : mointer_mq_python2.py # @Software: PyCharm # @Python_version: python2.7 import base64 import urllib2 import json import logging import sys def activemq_mointer(userinfo_encode): # 总的消息阻塞数 pending_queue_sum = 0 # 阻塞消息的队列名称 pending_queue_lists = '' # 总的消息数 mq_sum = 0 headers = { 'Authorization

6.4 基于证书的安全授权机制

房东的猫 提交于 2019-12-03 19:21:42
6.4 基于证书的安全授权机制- Certificate -based security 本章前面部分,我们讨论了使用ActiveMQ插件,通过客户端认证并授权客户端访问消息目的地的方式来保证代理的安全.这些插件可以正常的工作,但是他们使用明文来存储客户端的用户名 和密码等身份信息.对于大多数用户和大部分场景来说,这种方式已经足够使用,但是一些组织倾向于使用SSL证书来保证安全.第4章中,我们已经讨论过SSL传输连接器以及如何使用证书.本节中, 我们将探讨展开对证书的讨论并且告诉你如何使用SSL传输连接器(同时支持插件)来保证代理安全.我们将看到如何使用证书认证客户端,同时看到如何根据他们借以连接到代理的证书来分配不同 的访问控制权限. 本节中我们井继续使用stock portfolio例子中的publisher和consumer,但是这次他们将分别使用不同的证书以便表名身份以及获取发布和消费代理中消息目的地消息的访问权限. 6.4.1 准备证书 下面让我从创建证书开始.创建证书的过程和第4长配置基本的SSL传输连接器类似.本书附带的示例代码中包含了所有的证书,因此你可以在本例中使用. 我们将创建2个证书,一个名称为producer存储于文件名为myproducer.ks的keystore中.创建证书命令如下: C:\Users\goudcheng\tt>keytool