activemq

php 利用activeMq+stomp实现消息队列

一曲冷凌霜 提交于 2019-11-29 17:02:17
php 利用activeMq+stomp实现消息队列 一、activeMq概述   ActiveMQ 是Apache出品,最流行的,能力强劲的开源消息总线。ActiveMQ 是一个完全支持JMS1.1和J2EE 1.4规范的 JMS Provider实现,尽管JMS规范出台已经是很久的事情了,但是JMS在当今的J2EE应用中间仍然扮演着特殊的地位。 二、特性列表 ⒈ 多种语言和协议编写客户端。语言: Java,C,C++,C#, Ruby , Perl , Python , PHP 。应用协议: OpenWire,Stomp REST,WS Notification,XMPP, AMQP ⒉ 完全支持 JMS 1.1和 J2EE 1.4规范 (持久化,XA消息, 事务 ) ⒊ 对Spring的支持,ActiveMQ可以很容易内嵌到使用Spring的系统里面去,而且也支持Spring2.0的特性 ⒋ 通过了常见J2EE 服务器 (如 Geronimo,JBoss 4,GlassFish,WebLogic)的测试,其中通过JCA 1.5 resource adaptors的配置,可以让ActiveMQ可以自动的部署到任何兼容J2EE 1.4 商业服务器上 ⒌ 支持多种传送协议:in-VM,TCP,SSL,NIO,UDP,JGroups,JXTA ⒍

python使用stomp连接activemq

馋奶兔 提交于 2019-11-29 17:01:56
一、安装ActiveMQ服务 1. 当使用windows时,安装参考:https://blog.csdn.net/WuLex/article/details/78323811 启动:运行activemq.bat 2. 当使用linux时,安装参考:https://www.cnblogs.com/andylhc/p/9337628.html 启动:./activemq start 二、python使用stomp连接activemq 安装模块:pip3 install stomp.py (注意是python3) Python脚本如下: # -*- coding: utf-8 -*- """ Created on Thu Jul 19 09:54:08 2018 @author: lihc """ # -*-coding:utf-8-*- import stomp import time queue_name = '/queue/SampleQueue' topic_name = '/topic/SampleTopic' listener_name = 'SampleListener' post=61613 class SampleListener(object): def on_message(self, headers, message): print ('headers: %s'

python 通过stomp操作ActiveMQ

若如初见. 提交于 2019-11-29 17:01:37
最近用到了这个,记录一下。 python通过stomp协议与ActiveMQ通信。 首先要确认下ActiveMQ是否开启了stomp服务(默认是开启的): 端口号默认为:61613 发送与接收消息: 1 class MyListener(object): 2 3 def __init__(self, conn): 4 self.conn = conn 5 6 def on_error(self, headers, message): 7 print '$$$ received an error: %s from MQ' % message 8 9 def on_message(self, headers, message): 10 print '$$$ received a message: %s from MQ' % message 11 # print headers 12 self.conn.ack(id=headers['message-id'], subscription=headers['subscription']) # 消费消息记录 13 14 prepare_folder() 15 self.write_record(config_file, message) 16 17 def messagequeue_invoker(): 18 dest = '/queue

ActiveMQ的应用实例

南笙酒味 提交于 2019-11-29 17:01:19
一、部署和启动ActiveMQ 去官网下载: http://activemq.apache.org/ 我下载的是apache-activemq-5.12.0-bin.tar.gz, 解压到本地目录,进入到bin路径下, 运行activemq启动ActiveMQ。 运行方式: 启动 ./activemq start ActiveMQ默认使用的TCP连接端口是61616, 5.0以上版本默认启动时,开启了 内置的Jetty服务器 ,可以进入控制台查看管理。 启动ActiveMQ以后,登陆: http://localhost:8161/admin/ , 默认用户名 admin/admin 。 这里我在虚拟机里启动,访问地址: http://192.168.106.128:8161/admin/ ActiveMQ的控制台功能十分强大,管理起来也很直观。 二、使用Java连接 1.创建POM文件 在Eclipse中新建Java工程,这里使用Maven管理依赖, 下面是pom.xml: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0

消息中间件 ActiveMQ

Deadly 提交于 2019-11-29 16:47:19
常见的消息中间件产品: 【1】ActiveMQ:是 Apache 出品,最流行的,能力强劲的开源消息总线,ActiveMQ 是一个完全支持 JMS1.1 和 J2EE1.4 规范的 JMS Provider 实现,我们下面主要说明 ActiveMQ 的实现。 【2】RabbitMQ:AMQP 协议的领导实现,支持多种场景。淘宝的 MySQL 集群内部有使用它进行通讯。OpenStack 开源云平台的通信组件,最先在金融行业得到运用。 【3】ZeroMQ:史上最快的消息队列系统。 【4】Kafka:Apache 下的一个子项目,特点:高吞吐,在一台普通的服务器上既可以达到 10w/s 的吞吐速率,完全的分布式系统,适合处理海量数据。 一、什么是JMS? JMS(Java Message Service)是Java 平台上有关面向消息中间件的技术规范,它使消息系统中的 Java 应用程序进行消息交流,并且通过提供标准的产生、发送、接受消息的接口简化企业应用的开发。JMS 本身只定义了一系列的接口规范,是一种与厂商无关的 API。用来访问消息收发系统。它类似于 JDBC (java DataBase Connecivity),JDBC 是可以访问许多不同关系数据库的 API ,而 JMS 则提供同样与厂商无关的访问方法,以访问消息收发服务。目前许多厂商都支持 JMS,包括 IBM 的

How can I deploy a resource-adapter activation in JBoss 7?

佐手、 提交于 2019-11-29 15:32:21
I am trying to figure out how to deploy a resource-adapter activation in JBoss 7. Basically, I want to be able to package and deploy a full application without having to modify the base server configuration, in part because I want to bootstrap testing using Arquillian but also because I want to be able to deploy my packages into an environments where I may not have the option of modifying the base server's configuration. Here's where I am right now. I have created an EAR which contains the active-mq rar (which is also configured in the application.xml). This ear by itself builds and deploys

ActiveMQ authorization

自闭症网瘾萝莉.ら 提交于 2019-11-29 15:16:23
问题 If I want to implement JAAS authorization on Apache ActiveMQ, do I have to use the plug-in in the activemq.xml configuration file? This way is really NOT good because if I want to change authorization, I have to change the activemq.xml file and restart the server in order to work. Is there any way I can use like JAAS authentication by changing other properties file rather than the activemq.xml file? Or can I custom my own authorization plugin? Thanks. 回答1: Whenever I have set up ActiveMQ

ActiveMQ简介

余生颓废 提交于 2019-11-29 14:48:18
1 ActiveMQ 特征 多种语言和协议编写客户端。语言 : Java,C,C++,C#,Ruby,Perl,Python,PHP 。应用协议: OpenWire,Stomp REST,WS Notification,XMPP,AMQP 完全支持 JMS1.1 和 J2EE 1.4 规范 (持久化, XA 消息,事务 ) 对 Spring 的支持, ActiveMQ 可以很容易内嵌到使用 Spring 的系统里面去 通过了常见 J2EE 服务器(如 Geronimo,JBoss 4,GlassFish,WebLogic) 的测试,其中通过 JCA 1.5 resource adaptors 的配置,可以让 ActiveMQ 可以自动的部署到任何兼容 J2EE 1.4 商业服务器上 支持多种传送协议: in-VM,TCP,SSL,NIO,UDP,JGroups,JXTA 支持通过 JDBC 和 journal 提供高速的消息持久化 从设计上保证了高性能的集群,客户端 - 服务器,点对点 支持 Ajax 支持与 Axis 的整合 可以很容易的调用内嵌 JMS provider ,进行测试 一、 ActiveMQ 安装 ActiveMQ 官网: http://activemq.apache.org 来源: https://www.cnblogs.com/jacksonxiao/p

ActiveMQ概述

偶尔善良 提交于 2019-11-29 14:05:25
企业消息软件从80年代起就存在,它不只是一种应用间消息传递风格,也是一种集成风格。因此,消息传递可以满足应用间的通知和互相操作。但是开源的解决方案是到最近10年才出现的。Apache ActiveMQ就是其中一种。它使应用间能以异步,松耦合方式交流。ActiveMQ 是Apache出品,最流行的,能力强劲的开源消息总线。 ‍ ActiveMQ是Apache软件基金下的一个开源软件,它遵循JMS规范(Java Message Service),是消息驱动中间件软件(MOM)。它为企业消息传递提供高可用,出色性能,可扩展,稳定和安全保障。ActiveMQ使用Apache许可协议。因此,任何人都可以使用和修改它而不必反馈任何改变。这对于商业上将ActiveMQ用在重要用途的人尤为关键。MOM的工作是在分布式的各应用之间调度事件和消息,使之到达指定的接收者。所以高可用,高性能,高可扩展性尤为关键。 2.ActiveMQ特性 ⒈支持多种语言客户端,如:Java,C,C++,C#,Ruby,Perl,Python,PHP。应用协议有 OpenWire,Stomp REST,WS Notification,XMPP,AMQP。 ⒈支持多种语言客户端,如:Java,C,C++,C#,Ruby,Perl,Python,PHP。应用协议有 OpenWire,Stomp REST,WS

Getting a simple Spring JMS client acknowledge to work

柔情痞子 提交于 2019-11-29 11:54:40
问题 Just starting to get my head around getting JMS ActiveMQ Acknowledgements working in Spring. So far I have a consumer working perfectly, with the exception that when I don't acknowledge the message, it's still taken from the queue (I expect it to stay there or end in a dead letter queue). <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jms="http://www.springframework.org/schema/jms" xmlns:p="http://www.springframework.org