skip to Main Content

I have 2 endpoints that I would like to establish routes between. Due to the nature of these endpoints (JMS topics), I would like the bridging to be bidirectional.

The underlying JmsComponent for the Tibco endpoint has the pubSubNoLocal parameter enabled which ensures that a consumer does not receive messages it has itself sent as per http://camel.apache.org/jms.html

pubSubNoLocal false
Specifies whether to inhibit the delivery of messages published by its own connection.

However this has no effect since the 2 routes create separate connections to the JMS topic my.topic.

As a result, the following will create an infinite loop.
As mentioned, I need the routes to operate in both directions for “seamless integration”

<c:route>
            <c:from uri="tibco:topic:my.topic"/>
            <c:to uri="solace-jms:topic:mytopic" />
</c:route>
<c:route>
            <c:from uri="solace-jms:topic:mytopic"/>
            <c:to uri="tibco:topic:my.topic" />
</c:route>

2

Answers


  1. You will need to add some indication in the message that it has been sent through either bridge. You could play with existing properties (redelivery ?) or better add a new one. For example set property bridged=true when it passes your bridge. Then inside your definition you can filter out each message already bridged.

    Login or Signup to reply.
  2. I suggest le consideration the concepts of message selectors and headers.

    The way I see it, you do 2 things:

    • Add a “PRODUCER” header with your Server ID (however you define it)
    • All your listeners must be configured with a negative selector “NOT (PRODUCER=’YOUR_ID’)”

    Done ?

    (Of course, you could also use 2 topics… but I assume it is out of the question…)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search