2008-03-27
ActiveMQ + Python
首先试用了pyactivemq,不过这个代码在windows下测试用例都过不去。在linux下可以测试过,但是Durable..的测试程序工作不正常,ActiveMQ总是报无法从store中回复数据。
只好试stomp库。这个库的例程有些问题。我改了一下,我希望的功能可以用。
listener应该这样写:
class MyListener(stomp.ConnectionListener):
def on_error(self, headers, message):
print 'received an error %s' % message
def on_message(self, headers, message):
print 'received a message %s' % message
persist消息应该这样写:
conn.send( 'message %d' % sn , destination='/queue/hbtvweb', persistent='true')
就可以了
只好试stomp库。这个库的例程有些问题。我改了一下,我希望的功能可以用。
listener应该这样写:
class MyListener(stomp.ConnectionListener):
def on_error(self, headers, message):
print 'received an error %s' % message
def on_message(self, headers, message):
print 'received a message %s' % message
persist消息应该这样写:
conn.send( 'message %d' % sn , destination='/queue/hbtvweb', persistent='true')
就可以了
发表评论
- 浏览: 5206 次
- 性别:

- 来自: 北京

- 详细资料
搜索本博客
最近加入圈子
最新评论
-
jboss rules brms和ruleAg ...
楼主能把完整的文档贴出来吗
-- by dong_ta -
jboss rules brms和ruleAg ...
我用代理怎么老是出现这种错误啊!麻烦给指点一下哈!我的版本一致. RuleAge ...
-- by chunchun_1010 -
jboss rules brms和ruleAg ...
我在创建新的Rule时,在"Add a condition to the rul ...
-- by myim -
我的第一个Ajax Wicket ...
个人感觉javaeye的圈子似乎有些冷清。我觉得可能跟javaeye即有圈子,又 ...
-- by tailorcai -
我的第一个Ajax Wicket ...
为啥不加入wicket的圈子,然后把这两篇文章放到圈子博客里呢
-- by fakechris






评论排行榜