QPID学习

最近在看QPID
首先看下QPID是什么,他是个消息队列,用他有什么好处呢 ,可以跨平台使用,比如业务部分用C实现,把需要共享的信息通过QPID来传递,然后JAVA侧再从QPID接受消息


QPID官网:
http://qpid.apache.org/download.html

JAVA开发的话可以先在官网上下载一个 Java broker, client & tools qpid-java-0.20.tar.gz [PGP]

bin/qpid-server.bat 就可以启动

后面先研究如下几点

1、java开发服务端
研究几点,点对点的消息 、广播消息

2、java开发客户端
点对点消息的接收,接收后如何删除已经读取过的消息,使用 message.acknowledge()
广播消息的接收
消息格式的解析,一般采用字符串格式

3、qpid是否有tool可以看到当前的缓存情况
可以使用 qpid-jmx-management-console-0.18-win32-win32-x86.zip
下载地址 :http://www.eu.apache.org/dist/qpid/0.18/
[img]http://dl.iteye.com/upload/attachment/0082/0150/a3e2da70-097d-32c3-9bbc-4cafcbc841cb.png[/img]

4、QPID的性能问题,比如一个缓存队列的最大记录数,qpid开启时候设置jdk的虚拟内存等等


表 1. AMQP 的几个概念
概念 描述
Producer A program that writes messages to an Exchange. To do this, the program creates a message, fills the message with content, gives the message a Routing Key, and sends the message to an Exchange.
Routing Key A string that the Exchangecan use to determine to which Queuesthe message should be delivered.
Exchange Accepts messages from Producersand routes them to Queuesif the message meets the criteria expressed in a binding.
Binding Defines the relationship between an Exchangeand a Queue, specifying which messages should be routed to a given Queue
Queue Holds messages and delivers them to the Consumersthat subscribe to the Queue.
Consumer A program that reads messages from a Queue. A Consumercan create, subscribe to, share, use, or destroy Queueand their Bindings(as long as it has have permission to do so).


为了支持各种常见的通信模型,AMQP 定义了不同的 Exchange 类型,如下表所示 :


表 2. AMQP 定义的 Exchange 类型
Exchange 类型 路由行为
Fan-Out Messages are routed to every Queue bound to the Exchange, ignoring the Routing Key
Direct A message is routed only if a Queue's Binding Keyis the same as the message's Routing Key
Topic Similar to a Direct Exchange, but it supports multipart keys that contain multiple words separated by the "." delimiter; for instance, a message Producer can create messages with Routing Keys like usa.news, usa.weather, europe.news, and europe.weather.

参考资料

消息中间件 Apache Qpid 简介,第 1-2 部分
http://www.ibm.com/developerworks/cn/opensource/os-cn-qpid1/index.html
http://www.ibm.com/developerworks/cn/opensource/os-cn-qpid2/index.html


刚刚才开始研究! 等后面再补充吧




export PYTHONPATH=/usr/local/bin/qpid-tools-0.18/python/:/usr/local/bin/qpid-tools-0.18/src/py/
cd /usr/local/bin/qpid-tools-0.18/src/py/
./qpid-stat -q

qpidd --max-connections 2048 --auth no -d --log-to-file /var/log/mbus.log --log-enable warning+
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值