发布时间:2019-09-13 09:29:19编辑:auto阅读(1456)
ActiveMQ是Apache软件基金下的一个开源软件,是消息驱动中间件软件(MOM)。在分布式的各应用之间调度事件和消息,使之到达指定的接收者。它为企业消息传递提供高可用,出色性能,可扩展,稳定和安全保障
下载: http://activemq.apache.org/activemq-5131-release.html 选择安装版本
解压: tar zxvf apache-activemq-5.13.1-bin.tar.gz
打开部署文档(user-guide.html): cd pache-activemq-5.13.1/docs
执行 ./bin/activemq console 进入http://127.0.0.1:8161/admin username: admin password: admin
也可以后台运行:sudo ./bin/activemq start 停止: ./bin/activemq stop
import stomp
conn = stomp.Connection10()
conn.start()
conn.connect()
conn.send(‘SampleQueue’, ‘Simples Assim’)
conn.disconnect()
import stomp
conn = stomp.Connection10()
conn.start()
conn.connect()
conn.send(‘/topic/SampleTopic’, ‘Simples Assim’)
conn.disconnect()
import stomp
import time
class SampleListener(object):
def on_message(self, headers, message):
print message
conn = stomp.Connection10()
conn.set_listener(‘SampleListener’, SampleListener())
conn.start()
conn.connect()
conn.subscribe(‘SampleQueue’)
time.sleep(1) # secs
conn.disconnect()
import stomp
import time
class SampleListener(object):
def on_message(self, headers, message):
print message
conn = stomp.Connection10()
conn.set_listener(‘SampleListener’, SampleListener())
conn.start()
conn.connect()
conn.subscribe(‘/topic/SampleTopic’)
time.sleep(1) # secs
conn.disconnect()
博客来源: http://blog.csdn.net/juanjuel
上一篇: python合并ts视频
下一篇: python二元表达式
47848
46401
37285
34737
29318
25975
24918
19954
19549
18031
5795°
6419°
5932°
5964°
7070°
5917°
5948°
6441°
6405°
7782°