views:

140

answers:

2

Hi All,

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"&gt;
    <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?

+2  A: 

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

Claus Ibsen
Thanks Claus, this seems to work. only problem is that now all of my messages get sent to the remote NewTopic and local subscribers to OriginalTopic stop receiving messages. Any idea how to fix this?
chillitom
A: 

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

Dejan Bosanac