python+stomp+activemq
来源:互联网 发布:知乎日报 吐槽精选 编辑:程序博客网 时间:2024/05/01 14:43
python也可以连接MQ,以ActiveMQ为例,安装stomp.py:
https://github.com/jasonrbriggs/stomp.py
下载后安装:
python setup.py install
很简单,然后一个简单的示例:
import time
import sys
import stomp
class MyListener(object):
def on_error(self, headers, message):
print('received an error %s' % message)
def on_message(self, headers, message):
print('received a message %s' % message)
#官方示例的连接代码也落后了,现在分协议版本
conn = stomp.Connection10([('ip...',61613)])
conn.set_listener('', MyListener())
conn.start()
conn.connect()
conn.subscribe(destination='/queue/test', id=1, ack='auto')
#注意,官方示例这样发送消息是有问题的
#conn.send(body='hello,garfield! this is '.join(sys.argv[1:]), destination='/queue/test')
conn.send(body='hello,garfield!', destination='/queue/test')
time.sleep(2)
conn.disconnect()
http://www.cnblogs.com/GarfieldTom/p/4153957.html
- python+stomp+activemq
- python使用stomp连接activemq
- ActiveMQ - stomp 协议发送消息
- ActiveMQ - stomp 协议接收消息
- php+stomp+activemq,实现producer
- windows 7下python-activemq-stomp环境的搭建和测试
- python27 安装stomp支持activemq win64
- activeMQ+stomp+php实现消息队列
- ActiveMQ + NodeJS + Stomp 极简入门
- php 通过stomp协议连接ActiveMQ
- ActiveMQ+STOMP协议构建消息队列
- STOMP
- How does ActiveMQ compare to AMQP(Stomp和OpenWire)
- 消息处理利器 ActiveMQ 的介绍 & Stomp 协议的使用
- ActiveMQ - stomp 通过自定义转换器来支持 Map 消息传递
- Easy Messaging with STOMP over WebSockets using ActiveMQ and HornetQ
- Activemq 使用Stomp方式接收、过滤 topic 数据
- ActiveMQ系列—消息协议(Stomp协议)
- Proguard 部分类不混淆的技巧
- JS event使用方法详解
- 初识MariaDB存储引擎
- 156 Identify the persistent configuration setting for the target database that can be set for the ba
- 滑雪
- python+stomp+activemq
- 技术类博客网站推荐
- WebApi2 入门实例1
- Sed教程(一):简介、环境设置、工作流程
- Java编程思想学习心得(七)逻辑操作符和短路非短路
- Protocol Buffer技术详解(语言规范)
- unicode
- MyBatis+MySql Insert操作失败解决办法
- 平台主数据库支持类型及配置说明