Apache Qpid Java实战

0、官网:Apache Qpid

1、搭建Broker:Broker for Java

  这一步比较简单,按照Broker book即可完成。如果服务器有多个IP地址,需要绑定到某个IP的话,需要设置属性。参考Way to bind qpid to a different IP?

  引用重点部分如下:

For the AMQP port you need to set the bindingAddress parameter for the 
port, e.g.: 

{ 
    "authenticationProvider" : "passwordFile", 
    "bindingAddress" : "192.168.105.83", 
    "id" : "7236a3e5-9e74-440b-888b-2fdfcbe21695", 
    "name" : "AMQP", 
    "port" : 5672 
  } 

2、运行客户端(Sender & Receiver): Apache Qpid JMS Client for AMQP 0-10

  如果想偷懒的话,直接下载Qpid JMS for AMQP 0-9-1/0-10,修改ListSender.java和ListReceiver.java的new AMQConnection的url部分即可运行。详情参考Connection URLs

  先运行ListSender,然后在HTTP管理页面(用户名、密码参见broker根目录下etc/passwd文件)里,Broker - Virtual Hosts - 选中default - Virtual Host - View。Queues栏里应该能看到message_queue,其Depth(Bytes)应该为328B。

  接着运行ListReceiver(用-l参数即可),应该能打印出来Sender发生的信息;同时HTTP页面里的message_queue的Dept(Bytes)应该为0。


至此,一个简单的Qpid应用就搭建成功了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值