简体   繁体   English

带有多个tomcat的Activemq(JMS)

[英]Activemq (JMS) with multiple tomcats

Is it possible to produce a JMS event that will be consumed in a specific tomcat node? 是否可以产生将在特定的tomcat节点中使用的JMS事件? We are facing a problem that in our cluster of 3 tomcats - an event is thrown from one of the tomcats and is actually consumed by a different node even though we would like it to stick to the same tomcat (original) 我们面临的一个问题是,在我们的3个tomcat集群中-一个事件从其中一个tomcats抛出,并且实际上是由另一个节点消耗的,即使我们希望它坚持使用相同的tomcat(原始)

So, you share a broker between your Tomcat instances? 那么,您在Tomcat实例之间共享代理吗?

Fine, use separate topics/queues for each instance, maybe a prefix would be the easiest way. 很好,为每个实例使用单独的主题/队列,也许前缀是最简单的方法。

You can also send the tomcat instance ID (or what have you) as a JMS String property with each message. 您还可以将Tomcat实例ID(或您拥有的实例)作为JMS String属性与每个消息一起发送。 Then on the consumer, you consume with a selector that filter the message based on the instance Id. 然后,在使用者上,您需要使用一个选择器来使用,该选择器根据实例ID过滤消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM