在单个订阅中订阅所选路由键的消息(rabbitmq)

时间:2014-05-02 13:31:39

标签: spring spring-mvc rabbitmq messaging stomp

如何在单个订阅中订阅所选路由键的消息。例如:

用户发送由“tags”(tags =路由键)描述的消息:

messagingTemplate.convertAndSend("/topic/example.tagA.tagB.tagC.tagD"), sending_message);

我想订阅路由tagA或tagB的消息,所以当我输入2个订阅时它正在工作:

socket.stomp.subscribe("/topic/example.#.tagA.#", notify());
socket.stomp.subscribe("/topic/example.#.tagB.#", notify());

如果没有2个订阅但是更多例如,它是否有一些开销(例如网络开销)。 50? 如果以前的解决方案有开销,可以将这两个订阅加入一个吗?单个订阅中的解决方案看起来更好(因为更简洁)。

0 个答案:

没有答案