将 ActiveMq 主题路由到外部代理
我有一个 ActiveMq 主题,我希望对其进行转换并与外部代理共享。目前我有以下执行转换的内容:
<camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
<route>
<from uri="activemq:topic:OriginalTopic"/>
<to uri="xslt:file:///xslt/transformation.xsl"/>
<to uri="activemq:topic:NewTopic"/>
</route>
</camelContext>
但是,这只是将消息发送到当前的代理网络。我只想将 NewTopic 消息传递给外部代理。我不想使用
有没有一种简单的方法将消息路由到外部代理?
非常感谢。
UPDATE
上述方法也有一个缺点,即原始主题的订阅者不再接收消息,有没有办法在不丢失原始主题的情况下路由到另一个目的地?
I have an ActiveMq topic which I wish to transform and share with an external broker. At present I have the following which performs the transformation:
<camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
<route>
<from uri="activemq:topic:OriginalTopic"/>
<to uri="xslt:file:///xslt/transformation.xsl"/>
<to uri="activemq:topic:NewTopic"/>
</route>
</camelContext>
However this just sends the message to the current broker network. I'd like to pass the NewTopic messages to an external broker only. I don't want to join the external broker using a <networkConnector .. > as only this topic should be send to the external broker and no others.
Is there a simple way to route messages to an external broker?
Many thanks.
UPDATE
The above method also has the disadvantage that subscribers to original topic no longer receive messages, is there a way to route to another destination whilst not losing the original topic?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只需定义一个 ID 为 activemq2 的 spring bean,并为第二个外部代理配置其brokerURL。
那么最后一个 url 将是: activemq2:topic:NewTopic
Simply just define a spring bean with id activemq2 and have its brokerURL configured for the 2nd external broker.
Then the last to url will be: activemq2:topic:NewTopic
仅供参考,您可以过滤将在代理网络中转发的目的地。以此配置为例:
http://activemq.apache.org/ networks-of-brokers.html#NetworksofBrokers-ExampleConfigurationusingNetworkConnectorproperties
Just for the reference, you can filter destinations that will be forwarded in network of brokers. Take this configuration for example:
http://activemq.apache.org/networks-of-brokers.html#NetworksofBrokers-ExampleConfigurationusingNetworkConnectorproperties