Routing an ActiveMq topic to an external broker
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 transforma开发者_运维问答tion:
<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?
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
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
精彩评论