activemq

ansible部署java及数据库环境

左心房为你撑大大i 提交于 2019-11-28 19:26:30
  wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.1.rpm   wget https://artifacts.elastic.co/downloads/logstash/logstash-6.3.1.rpm   wget https://artifacts.elastic.co/downloads/kibana/kibana-6.3.1-x86_64.rpm 1. 安装ansible yum install epel-release -y && yum install -y ansible  配置ansible服务器实现免密登录,配置之后,第一次需要在ansible服务器上ssh 2. 默认配置文件在/etc/ansible加入以下配置[test]服务器组可随意命名 [test] 192.168.0.21 192.168.0.52 3. 创建java及data目录 ----java对应的java环境及中间件,data数据库等 mkdir -pv /etc/ansible/java/roles/{prepare,jdk,redis,zk,mq}/{tasks,files,templates,vars,meta,default,handlers} mkdir -pv /etc

ACTIVEMQ- publisher subscriber hello world example

淺唱寂寞╮ 提交于 2019-11-28 18:21:18
There are two programs: subscriber and publisher... Subscriber is able to put the message onto the topic and the message is sent successfully. When I check the activemq server on my browser it shows 1 msg enqueued . But when I run the consumer code, it is not receiving the message Here is the producer code: import javax.jms.*; import org.apache.activemq.ActiveMQConnection; import org.apache.activemq.ActiveMQConnectionFactory; public class producer { private static String url = ActiveMQConnection.DEFAULT_BROKER_URL; public static void main(String[] args) throws JMSException { ConnectionFactory

ActiveMQ入门操作示例

微笑、不失礼 提交于 2019-11-28 16:17:45
1. Queue 1.1 Producer   生产者:生产消息,发送端。   把jar包添加到工程中。    第一步:创建ConnectionFactory对象,需要指定服务端ip及端口号。 第二步:使用ConnectionFactory对象创建一个Connection对象。 第三步:开启连接,调用Connection对象的start方法。 第四步:使用Connection对象创建一个Session对象。 第五步:使用Session对象创建一个Destination对象(topic、queue),此处创建一个Queue对象。 第六步:使用Session对象创建一个Producer对象。 第七步:创建一个Message对象,创建一个TextMessage对象。 第八步:使用Producer对象发送消息。 第九步:关闭资源。 1 /** 2 * 点到点形式发送消息 3 */ 4 @Test 5 public void testQueueProducer() throws Exception{ 6 //1、创建一个连接工厂对象,需要指定服务的ip及端口。 7 ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://192.168.83.102:61616"); 8 //2

Which is better: PooledConnectionFactory or CachingConnectionFactory?

馋奶兔 提交于 2019-11-28 16:14:01
We use Spring (3.2.4) with ActiveMQ (5.8.0) in Tomcat (7.0.41) and it is not clear what the best usage. We want to use JmsTemplate to produce and MessageListenerContainer to receive messages. Should we use caching in receiver side? ( related link ) Works CachingConnectionFactory with ActiveMQ and failover? ( related link ) Need to set useAsyncSend="true" when we use PooledConnectionFactory? ( related link ) Jaqen H'ghar From here : The difference between the PooledConnectionFactory and the CachingConnectionFactory is a difference in implementation. Below are some of the characteristics that

ActiveMQ高级特性

荒凉一梦 提交于 2019-11-28 15:50:37
一、常用配置属性   以下配置文件目录均为:${activemq_home}/conf/activemq.xml   1、定期扫描清理     ActiveMQ中有一项功能:Delete Inactive Destination。可以处理 “ 没有消费者且未处理的Destination”,也就是 queue 或者 topic 在规定时间内,没有入队记录或者有效订阅,会被清理删除。     下面基于Queue的配置,Topic的配置类似。          其中属性定义:schedulePeriodForDestinationPurge - 必填。声明扫描闲置队列的周期,单位毫秒。默认值0,为不扫描。            gcInactiveDestinations - 必填。针对Destination的配置,声明Broker扫描闲置队列时,是否扫描此队列。默认值false            inactiveTimoutBeforeGC - 选填。配合gcInactiveDestinations=true时才生效。声明Destination闲置多久可以进行删除,单位毫秒。默认值60。   2、存储空间设置          其中的配置标签: memoryUsage - 表示ActiveMQ使用的内存

ActiveMQ安装

我与影子孤独终老i 提交于 2019-11-28 15:08:42
Linux安装: ​ ​ ​ ​ <plugins> <simpleAuthenticationPlugin> <users> <authenticationUser username="wusc" password="wusc.123" groups="users,admins"/> </users> </simpleAuthenticationPlugin> </plugins> (备注:plugins放在shutdownHooks下面,如下图所示) ​ ​ Window安装: 下载activemq http://activemq.apache.org/ 解压activemq apache-activemq-5.11.1.zip 配置jdk环境 略: 启动activemq ​ ​ 访问activemq http://localhost:8161 来源: https://www.cnblogs.com/chuhongyun/p/11411799.html

activemq的下载与安装

不想你离开。 提交于 2019-11-28 14:07:23
一、介绍 Apache ActiveMQ™是最流行的开源,多协议,基于Java的消息服务器。 它支持行业标准协议,因此用户可以通过广泛的语言和平台获得客户选择的好处。 可以使用C,C ++,Python,.Net等连接。 使用无处不在的 AMQP 协议 集成您的多平台应用程序 。 使用 STOMP 通过websockets 在Web应用程序之间交换消息 。 使用 MQTT 管理您的IoT设备 。 支持您现有的 JMS 基础架构及其他。 ActiveMQ提供强大的功能和灵活性,以支持任何消息传递用例。 1.去官网下载 https://activemq.apache.org/components/classic/download/ 2.借助工具上传至linux 3.解压 4.进入,并启动 5.查看是否启动 来源: https://www.cnblogs.com/wanerhu/p/11410158.html

ActiveMQ 消息存储持久化

馋奶兔 提交于 2019-11-28 12:57:21
ActiveMQ中对于投递模式设置为持久化的消息, broker 接收到到消息之后,会 先把消息存储到存储介质 ,然后 再转发到消息的监听者 ActiveMQ持久化方式:AMQ、KahaDB、JDBC、LevelDB 持久化配置路径: ActiveMQ\apache-activemq\conf\activemq.xml Message保存方式 PERSISTENT :保存到磁盘,consumer消费之后,message被删除。 NON_PERSISTENT :保存到内存,消费之后message被清除。 kahaDB 持久化为文件(默认) 所有消息顺序添加到一个日志文件中,同时另外有一个索引文件记录指向这些日志的存储地址,还有一个事务日志用于消息回复操作。 特点:基于文件的本地数据库储存形式,是一个支持事务,可靠,高性能,可扩展的消息存储器。 在data/kahadb这个目录下,会生成四个文件,来完成消息持久化 db.data 它是消息的索引文件,本质上是 B-Tree(B树) ,使用B-Tree作为索引指向 db-*.log 里面存储的消息 一旦这个消息不在被需要,数据文件可以被删除或归档。 db.redo 用来进行消息恢复 db-*.log 存储消息内容。新的数据以 APPEND 的方式追加到日志文件末尾。属于顺序写入,因此消息存储是比较快的。默认是 32M ,达到阀值会自动递增

Spring Boot 整合 ActiveMQ

旧时模样 提交于 2019-11-28 11:20:05
依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-activemq</artifactId> </dependency> <!--消息队列连接池--> <dependency> <groupId>org.apache.activemq</groupId> <artifactId>activemq-pool</artifactId> <version>5.15.0</version> </dependency> 配置文件(application.yml) server: port: 61616 spring: activemq: broker-url: tcp://localhost:61616 user: admin password: admin jms: pub-sub-domain: false # false=queue true=topic #定义队列名称 myqueue: activemq-queue #true 表示使用内置的MQ,false则连接服务器 spring.activemq.in-memory=false #true表示使用连接池;false时,每发送一条数据创建一个连接 spring.activemq.pool

Spring 整合 ActiveMQ

感情迁移 提交于 2019-11-28 10:59:10
Spring官方提供了一个叫 JmsTemplate 的类,这个类就专门用来处理JMS的,在 该类的Bean配置标签 中有两个属性 connectionFactory-ref 和 defaultDestination-ref 正好对应JMS中的 ConnectionFactory 和 Destination 依赖 <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jms</artifactId> </dependency> <dependency> <groupId>org.apache.activemq</groupId> <artifactId>activemq-pool</artifactId> </dependency> <dependency> <groupId>org.apache.activemq</groupId> <artifactId>activemq-all</artifactId> </dependency> 配置文件 来源: https://www.cnblogs.com/loveer/p/11405884.html