You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by andi welchlin <an...@gmail.com> on 2018/01/22 13:24:09 UTC

Bidirectional route combined with binding to queue

Hello all,

I want to share an exchange between two brokers (bidirectional).

I understood that the right way to do this is using a dynamic route like:

qpid-route dynamic add $broker1 $broker2 $exchange_name
qpid-route dynamic add $broker2 $broker1 $exchange_name


I also want to achieve that no messages will be lost when one of the
two brokers is down while messages are sent to the other broker.

So I would bind a queue ($queue_out) to $exchange_name on both brokers.
Then I would route on each broker $queue_out to the exchange of the remote
broker.

As far as I understood a dynamic route is then not possible any more.

It would look like:

# install binding from exchange to output queue
qpid-config -b $BROKER1 bind $exchange_name $queue_out
qpid-config -b $BROKER2 bind $exchange_name $queue_out

# install route
qpid-route -d queue add $BROKER2 $BROKER1 $exchange_name $queue_out
qpid-route -d queue add $BROKER1 $BROKER2 $exchange_name $queue_out
qpid-route route map $BROKER2


But this seems to lead to circular messages.

Does anyone have a solution for this scenario?

Kind Regards,
Andreas

Re: Bidirectional route combined with binding to queue

Posted by Gordon Sim <gs...@redhat.com>.
On 22/01/18 15:05, andi welchlin wrote:
> Qpid.trace.id would be found in the message header, I think.

Correct (with AMQP 1.0 it's in the message-annotations)

> So this would break anonymity.

If by anonymity you mean there can be no way to distinguish which broker 
it arrived at first, then this would not meet that. You could use a 
fairly opaque id however (e.g. a uuid) which would make it less obvious, 
but it would still be possible to see which messages originated at the 
same broker.

> Any ideas?

Unfortunately this is the only mechanism built into the c++ broker that 
would prevent message looping.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Bidirectional route combined with binding to queue

Posted by andi welchlin <an...@gmail.com>.
Hello Gordon,

thank you for your answer.

I forgot to mention that messages need to be anonymous in my environment,
as well :-)

Qpid.trace.id would be found in the message header, I think. So this would
break anonymity.

Any ideas?

Kind Regards,
Andreas



On Mon, Jan 22, 2018 at 3:13 PM, Gordon Sim <gs...@redhat.com> wrote:

> On 22/01/18 13:24, andi welchlin wrote:
>
>> Hello all,
>>
>> I want to share an exchange between two brokers (bidirectional).
>>
>> I understood that the right way to do this is using a dynamic route like:
>>
>> qpid-route dynamic add $broker1 $broker2 $exchange_name
>> qpid-route dynamic add $broker2 $broker1 $exchange_name
>>
>>
>> I also want to achieve that no messages will be lost when one of the
>> two brokers is down while messages are sent to the other broker.
>>
>> So I would bind a queue ($queue_out) to $exchange_name on both brokers.
>> Then I would route on each broker $queue_out to the exchange of the remote
>> broker.
>>
>> As far as I understood a dynamic route is then not possible any more.
>>
>> It would look like:
>>
>> # install binding from exchange to output queue
>> qpid-config -b $BROKER1 bind $exchange_name $queue_out
>> qpid-config -b $BROKER2 bind $exchange_name $queue_out
>>
>> # install route
>> qpid-route -d queue add $BROKER2 $BROKER1 $exchange_name $queue_out
>> qpid-route -d queue add $BROKER1 $BROKER2 $exchange_name $queue_out
>> qpid-route route map $BROKER2
>>
>>
>> But this seems to lead to circular messages.
>>
>> Does anyone have a solution for this scenario?
>>
>
> You can use the "qpid.trace.id" and "qpid.trace.exclude" queue options
> for this.
>
> For each of the two forwarding queues, set the id to the name of the
> broker the queue is on and set the excludes to a list containing the other
> brokers id.
>
> That way messages from the other broker are not enqueued on the forwarding
> queue, so will not get forwarded back.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
>

Re: Bidirectional route combined with binding to queue

Posted by Gordon Sim <gs...@redhat.com>.
On 22/01/18 13:24, andi welchlin wrote:
> Hello all,
> 
> I want to share an exchange between two brokers (bidirectional).
> 
> I understood that the right way to do this is using a dynamic route like:
> 
> qpid-route dynamic add $broker1 $broker2 $exchange_name
> qpid-route dynamic add $broker2 $broker1 $exchange_name
> 
> 
> I also want to achieve that no messages will be lost when one of the
> two brokers is down while messages are sent to the other broker.
> 
> So I would bind a queue ($queue_out) to $exchange_name on both brokers.
> Then I would route on each broker $queue_out to the exchange of the remote
> broker.
> 
> As far as I understood a dynamic route is then not possible any more.
> 
> It would look like:
> 
> # install binding from exchange to output queue
> qpid-config -b $BROKER1 bind $exchange_name $queue_out
> qpid-config -b $BROKER2 bind $exchange_name $queue_out
> 
> # install route
> qpid-route -d queue add $BROKER2 $BROKER1 $exchange_name $queue_out
> qpid-route -d queue add $BROKER1 $BROKER2 $exchange_name $queue_out
> qpid-route route map $BROKER2
> 
> 
> But this seems to lead to circular messages.
> 
> Does anyone have a solution for this scenario?

You can use the "qpid.trace.id" and "qpid.trace.exclude" queue options 
for this.

For each of the two forwarding queues, set the id to the name of the 
broker the queue is on and set the excludes to a list containing the 
other brokers id.

That way messages from the other broker are not enqueued on the 
forwarding queue, so will not get forwarded back.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org