将 ActiveMq 主题路由到外部代理

发布于 2024-08-27 09:19:29 字数 713 浏览 3 评论 0原文

我有一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

第几種人 2024-09-03 09:19:29

只需定义一个 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

舂唻埖巳落 2024-09-03 09:19:29

仅供参考,您可以过滤将在代理网络中转发的目的地。以此配置为例:

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文