You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Ewerton Scaboro da Silva <ew...@microsoft.com> on 2015/10/26 19:28:13 UTC

How to handle redirection on proton-c?

Hey folks,

Would you have any pointers on how to handle redirection using proton-c?

This is the code I'm calling:

pn_messenger_recv(messenger, -1);


And this is what I get on the logs:

[00FF1D78]:0 <- @attach(18) [name="messages/events/my-amqp-hub/ConsumerGroups/teryiaki-is-good/Partitions/4", handle=0, role=false, snd-settle-mode=1, rcv-settle-mode=0, initial-delivery-count=0, max-message-size=1048576]
[00FF1D78]:0 <- @detach(22) [handle=0, closed=true, error=@error(29) [condition=:"amqp:link:redirect", description="An AMQP error occurred (condition='amqp:link:redirect').", info={:hostname="redirect.to.this.fqdn.com", :"network-host"="redirect.to.this.fqdn.com", :port=5671, :address="amqps://redirect.to.this.fqdn.com:5671/my-amqp-hub/my-amqp-hub/ConsumerGroups/ teryiaki-is-good/Partitions/4", :"com.mycompany:tracking-id"="e1954f37a37644379a4e336d0f17a19e-G:0-TimeStamp:10/23/2015 22:57:25"}]]
[00FF1D78]:0 -> @detach(22) [handle=0, closed=true]


The same code works fine connecting directly.

Thanks,
Ewerton Scaboro da Silva

Re: How to handle redirection on proton-c?

Posted by Gordon Sim <gs...@redhat.com>.
On 10/26/2015 06:28 PM, Ewerton Scaboro da Silva wrote:
> Hey folks,
>
> Would you have any pointers on how to handle redirection using proton-c?
>
> This is the code I'm calling:
>
> pn_messenger_recv(messenger, -1);
>
>
> And this is what I get on the logs:
>
> [00FF1D78]:0 <- @attach(18) [name="messages/events/my-amqp-hub/ConsumerGroups/teryiaki-is-good/Partitions/4", handle=0, role=false, snd-settle-mode=1, rcv-settle-mode=0, initial-delivery-count=0, max-message-size=1048576]
> [00FF1D78]:0 <- @detach(22) [handle=0, closed=true, error=@error(29) [condition=:"amqp:link:redirect", description="An AMQP error occurred (condition='amqp:link:redirect').", info={:hostname="redirect.to.this.fqdn.com", :"network-host"="redirect.to.this.fqdn.com", :port=5671, :address="amqps://redirect.to.this.fqdn.com:5671/my-amqp-hub/my-amqp-hub/ConsumerGroups/ teryiaki-is-good/Partitions/4", :"com.mycompany:tracking-id"="e1954f37a37644379a4e336d0f17a19e-G:0-TimeStamp:10/23/2015 22:57:25"}]]
> [00FF1D78]:0 -> @detach(22) [handle=0, closed=true]
>
>
> The same code works fine connecting directly.

I don't believe there is any code in messenger that handles link level 
redirect at this time (it can I think handle connection level redirect).

You could use the engine/reactive api instead of messenger, handle the 
link closed event and based on the condition attempt a connection and 
attachment as directed.

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