ActiveMQ队列特性:组合队列(Composite Destinations)

来源:互联网 发布:淘宝聊天软件 编辑:程序博客网 时间:2024/05/22 12:16

组合队列(Composite Destinations)

当你想把同一个消息一次发送到多个消息队列,那么可以在客户端使用组合队列。

// send to 3 queues as one logical operationQueue queue = new ActiveMQQueue("FOO.A,FOO.B,FOO.C");producer.send(queue, someMessage);

当然,也可以混合使用队列和主题,只需要使用前缀:queue:// 或 topic://

// send to queues and topic one logical operationQueue queue = new ActiveMQQueue("FOO.A,topic://NOTIFY.FOO.A");producer.send(queue, someMessage);

还有一种更透明的方式是在broker端使用,需要配合虚拟队列。



原创粉丝点击