1

I'm looking for a RabbitMQ replacement in a PHP project. Two options I am considering so far are Kestrel and Qpid (if we decide to stick with AMQP (which I would like to avoid)). In RabbitMQ, you can send a message to an exchange (destination), which decides which queues or topics (in JMS terms) the message should be delivered to. What stops me from choosing a STOMP server (ActiveMQ/Apollo or HornetQ) is that I can't find out whether it is possible in STOMP to SEND a message to a destination so that the message is delivered to a number of queues (in JMS terms)? The sender is not supposed to know which queues the message should be delivered to.

Thank you.

4

3 回答 3

1

您可以在 ActiveMQ 中使用名为Composite Destinations的东西来使用 Stomp 或标准 JMS 客户端来执行此操作。Stomp 目的地以 /queue/ 字符串为前缀,然后是目的地的名称。您还可以在 ActiveMQ中使用虚拟目标。当然,ActiveMQ 中的 Destination 字符串可以支持通配符

于 2012-04-04T14:53:50.913 回答
1

在 HornetQ 中,您可以使用Diverts(独占和非独占)。STOMP 消息将到达原始队列,但随后将透明地转移到 hornetq-configuration.xml 中配置的适当队列。

您还可以应用带有转移的过滤器,以便将消息隔离到适当的队列中。

于 2012-04-05T14:37:54.820 回答
0

我自己也面临同样的问题,并通过 ActiveMQ XML 中的以下配置解决了。

<destinationInterceptors>
 <virtualDestinationInterceptor> 
  <virtualDestinations> 
   <compositeQueue name="MY.QUEUE">
    <forwardTo>
     <queue physicalName="FOO" /> 
     <queue physicalName="BAR" />
    </forwardTo>
   </compositeQueue>
  </virtualDestinations>
 </virtualDestinationInterceptor>
</destinationInterceptors> 

参考http://activemq.apache.org/virtual-destinations.html

于 2018-06-08T21:58:39.040 回答