I'm having troubles setting up a topic bridge in HornetQ (related to earlier question). The idea is this:
- A notification gets posted to a topic on HornetQ server A
- This notification gets sent to a topic on HornetQ server B over a core bridge
- The client app gets the notification from server B.
The problem I'm having now is that if server B is down, the notification gets dropped. I would use a queue, but we need other subscribers. I was hoping the bridge would be durable, and messages would make it to the topic on server B. The way I have it set up is in the hornetq-configuration.xml:
<queues>
<queue name="jms.topic.topic.dat.cds.internal">
<address>jms.topic.topic.dat.cds.internal</address>
</queue>
</queues>
<bridges>
<bridge name="cds-bridge">
<queue-name>jms.topic.topic.dat.cds.internal</queue-name>
<forwarding-address>jms.topic.topic.dat.cds</forwarding-address>
<reconnect-attempts>-1</reconnect-attempts>
<use-duplicate-detection>true</use-duplicate-detection>
<static-connectors>
<connector-ref>remote-connector</connector-ref>
</static-connectors>
</bridge>
</bridges>
This works only if both servers are up.
Is there a way to make the bridge a durable subscriber? Is there something I'm missing?
[EDIT - solution] - This works. The trick is the topic names need to be the same.
<queues>
<queue name="jms.topic.topic.dat.cds">
<address>jms.topic.topic.dat.cds</address>
</queue>
<bridges>
<bridge name="cds-bridge">
<queue-name>jms.topic.topic.dat.cds</queue-name>
<forwarding-address>jms.topic.topic.dat.cds</forwarding-address>
<reconnect-attempts>-1</reconnect-attempts>
<use-duplicate-detection>true</use-duplicate-detection>
<static-connectors>
<connector-ref>remote-connector</connector-ref>
</static-connectors>
</bridge>
</bridges>