activemq

RocketMQ学习笔记(1)----RocketMQ的简介

℡╲_俬逩灬. 提交于 2020-03-23 06:52:13
1. 什么是RocketMQ?         是一个队列模型的消息中间件,具有高性能、高可靠、高实时、分布式特点。   Producer、Consumer、队列都可以分布式。    Producer 吐一些队列轮流収送消息,队列集合称为Topic,Consumer 如果做广播消费,则一个consumer   实例消费返个Topic 对应的所有队列,如果做集群消费,则多个Consumer 实例平均消费返个topic 对应的   队列集合。   能够保证严格的消息顺序   提供丰富的消息拉叏模式   高效的订阅者水平扩展能力   实时的消息订阅机制   亿级消息堆积能力   较少的依赖   RocketMQ作为阿里巴巴的两大分布式技术之一,是一款纯java、分布式、队列模型的开源消息中间件,他参考了Java的JMS规范,但是它并没有遵循JMS的规范,经历了淘宝双十一的洗礼,在功能和性能上据说是远超ActiveMQ。 2. RocketMQ发展史   1. Metaq(Metamorphsis) 1.x    由开源社区killme2008维护,开源社区非常活跃。    github地址:https://github.com/killme2008/Metamorphosis   2. Metaq 2.x    于2012年10月份上线,在淘宝内部被广泛使用。   3.

大型网站系统架构系列:分布式消息队列(二)

旧时模样 提交于 2020-03-22 03:43:14
四、JMS消息服务 讲消息队列就不得不提JMS 。JMS(JAVA Message Service,java消息服务)API是一个消息服务的标准/规范,允许应用程序组件基于JavaEE平台创建、发送、接收和读取消息。它使分布式通信耦合度更低,消息服务更加可靠以及异步性。 在EJB架构中,有消息bean可以无缝的与JM消息服务集成。在J2EE架构模式中,有消息服务者模式,用于实现消息与应用直接的解耦。 4.1消息模型 在JMS标准中,有两种消息模型P2P(Point to Point),Publish/Subscribe(Pub/Sub)。 4.1.1 P2P模式 P2P模式包含三个角色:消息队列(Queue),发送者(Sender),接收者(Receiver)。每个消息都被发送到一个特定的队列,接收者从队列中获取消息。队列保留着消息,直到他们被消费或超时。 P2P的特点 每个消息只有一个消费者(Consumer)(即一旦被消费,消息就不再在消息队列中) 发送者和接收者之间在时间上没有依赖性,也就是说当发送者发送了消息之后,不管接收者有没有正在运行,它不会影响到消息被发送到队列 接收者在成功接收消息之后需向队列应答成功 如果希望发送的每个消息都会被成功处理的话,那么需要P2P模式。(架构KKQ:466097527,欢迎加入) 4.1.2 Pub/sub模式 包含三个角色主题

centos 安装apache activemq

给你一囗甜甜゛ 提交于 2020-03-22 00:00:41
安装说明 安装环境:CentOS-6.3 安装方式:源码安装 软件:apache-tomcat-7.0.29.tar.gz 下载地址 http://activemq.apache.org/download.html 1、mkdir /usr/apachemq 2、上传apachemq 3、解压apachemq tar -xzvf /usr/apachemq/apache-activemq-5.6.0-bin.tar.gz 4、修改activemq运行文件的权限 cd /usr/apachemq/apache-activemq-5.6.2/bin chmod 755 activemq 运行./activemq 5、关闭防火墙 vi + /etc/sysconfig/iptables #添加下面两行 -A INPUT -m state --state NEW -m tcp -p tcp --dport 8161 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 61616 -j ACCEPT 6、重启防火墙 [root@localhost linux-x86-64]# service iptables restart 7、 启动 ./apachemq 测试地址 http://172.16.87.130:8161

activemq 高级使用

試著忘記壹切 提交于 2020-03-21 22:44:57
package top.activemq.util.performance; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.ActiveMQMessageProducer; import org.apache.activemq.AsyncCallback; import java.util.UUID; import javax.jms.Connection; import javax.jms.JMSException; import javax.jms.Queue; import javax.jms.Session; import javax.jms.TextMessage; /** * description:异步投递 * * //1、在brokerUri后跟jms.useAsyncSend参数 * cf = new ActiveMQConnectionFactory("tcp://locahost:61616?jms.useAsyncSend=true"); * //2、设置connectionFactory的useAsyncSend属性,此时要注意ConnectionFactory的类型必须是ActiveMQConnectionFactory * (

activemq 高级使用

谁说我不能喝 提交于 2020-03-21 20:15:19
3 月,跳不动了?>>> package top.activemq.util.performance; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.ActiveMQMessageProducer; import org.apache.activemq.AsyncCallback; import java.util.UUID; import javax.jms.Connection; import javax.jms.JMSException; import javax.jms.Queue; import javax.jms.Session; import javax.jms.TextMessage; /** * description:异步投递 * * //1、在brokerUri后跟jms.useAsyncSend参数 * cf = new ActiveMQConnectionFactory("tcp://locahost:61616?jms.useAsyncSend=true"); * //2、设置connectionFactory的useAsyncSend属性

Using Quartz with Mule in Clustered Environment

蹲街弑〆低调 提交于 2020-03-21 02:40:24
问题 I have a scenario where , I am trying to read data from Yelp API and want to put it into a ActiveMQ queue after certain intervals, So I am using quartz scheduler for the same.My quartz scheduler runs after every 10 minutes and pushes the data to queue, All is fine till here, Now I want this to work in a clustered environment, where I will have 2 instances deployed and listening to same Yelp Endpoint , Now what is happening is, my quartz scheduler from 2 instances are executing at same

Using Quartz with Mule in Clustered Environment

戏子无情 提交于 2020-03-21 02:40:13
问题 I have a scenario where , I am trying to read data from Yelp API and want to put it into a ActiveMQ queue after certain intervals, So I am using quartz scheduler for the same.My quartz scheduler runs after every 10 minutes and pushes the data to queue, All is fine till here, Now I want this to work in a clustered environment, where I will have 2 instances deployed and listening to same Yelp Endpoint , Now what is happening is, my quartz scheduler from 2 instances are executing at same

使用activemq和redis笔记

我的梦境 提交于 2020-03-20 23:28:49
import net.sf.json.JSONObject; import org.apache.tomcat.jni.Time; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.jms.annotation.JmsListener; import org.springframework.jms.core.JmsMessagingTemplate; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import javax.jms.Queue; import javax.servlet.http.HttpSession;

What's the Purpose of setting the clientID for JMS publisher / consumer?

天涯浪子 提交于 2020-03-19 19:34:13
问题 I understand that i need to set the clientId and subscription name when writing the jms topic subscriber for my durable topics. But Whats the purpose of setting the clientID when publishing the TOPIC ? I have seen people setting the client Id even for publisher / consumer, but no one explained that why it is required. ConnectionFactory conFactory = this.getConnectionFactory(); Connection connection = conFactory.createConnection(); connection.setClientID("WHATS_MY_PURPOSE"); // Why do we need

activeMQ安装与使用

半腔热情 提交于 2020-03-18 17:24:38
下载 官方网站下载: http://activemq.apache.org/ 安装(Linux) (1)将apache-activemq-5.12.0-bin.tar.gz 上传至服务器 (2)解压此文件 tar zxvfapache-activemq-5.12.0-bin.tar.gz (3)为apache-activemq-5.12.0目录赋权 chmod 777 apache-activemq-5.12.0 (4)进入apache-activemq-5.12.0\bin目录 (5)赋与执行权限 chmod 755 activemq -------------------------------------- 知识点小贴士 -------------------------- linux 命令chmod 755的意思 chmod是 Linux 下设置文件权限的命令,后面的数字表示不同用户或用户组的权限。 一般是三个数字: 第一个数字表示文件所有者的权限 第二个数字表示与文件所有者同属一个用户组的其他用户的权限 第三个数字表示其它用户组的权限。 权限分为三种:读(r=4),写(w=2),执行(x=1) 。 综合起来还有可读可执行(rx=5=4+1)、可读可写(rw=6=4+2)、可读可写可执行(rwx=7=4+2+1)。 所以,chmod 755 设置用户的权限为: 1