组合队列(Composite Destinations)
当你想把同一个消息一次发送到多个消息队列,那么可以在客户端使用组合队列。
// send to 3 queues as one logical operation
Queue queue = new ActiveMQQueue("FOO.A,FOO.B,FOO.C");
producer.send(queue, someMessage);
当然,也可以混合使用队列和主题,只需要使用前缀:queue:// 或 topic://
// send to queues and topic one logical operation
Queue queue = new ActiveMQQueue("FOO.A,topic://NOTIFY.FOO.A");
producer.send(queue, someMessage);
还有一种更透明的方式是在broker端使用,需要配合虚拟队列。
本文介绍如何利用组合队列技术一次性将消息发送到多个队列,包括队列与主题的混合使用方法及在broker端配合虚拟队列实现的更透明方式。
156

被折叠的 条评论
为什么被折叠?



