You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Vavricka <va...@gmail.com> on 2017/03/07 13:25:23 UTC

[Qpid Java Broker] Remove alternate exchange

Hi, 

  I have two exchanges with alternate exchange set to the other exchange.

 Below are the two exchanges in following format <Exchange name,Alternate
exchange>

  broadcast,broadcast_resend
  broadcast_resend,broadcast

  I am trying to remove exchange by REST API.

 When I tried to remove exchange 'broadcast' Java Broker complained that
exchange is used in another exchange as alternate exchange.

  Then I tried to remove alternate exchange from exchange 'broadcast'.
  I tried to remove alternate exchange by configured object update as
described at
https://qpid.apache.org/releases/qpid-java-6.1.1/java-broker/book/Java-Broker-Management-Channel-REST-API.html
(section 6.3.5).

  I tried to set parameters to { "alternateExchange" : "" } which failed
with error "Cannot convert '' into a
org.apache.qpid.server.model.Exchange<?> for attribute alternateExchange
(Could not find object of category Exchange with name '')".

  Then I tried to set whole exchange object. I received JSON string of
exchange object, map it to Jackson JsonNode, remove "alternateExchange" key
and then made configured object update of exchange with rest of exchange
parameters. This call successfully passes, but no change is done, alternate
exchange still persists.

  Is this the correct way how to remove exchange with alternate exchange?

  Vavricka



--
View this message in context: http://qpid.2158936.n2.nabble.com/Qpid-Java-Broker-Remove-alternate-exchange-tp7660147.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

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


Re: [Qpid Java Broker] Remove alternate exchange

Posted by Vavricka <va...@gmail.com>.
It worked like a charm.

Thanks.

Vavricka



--
View this message in context: http://qpid.2158936.n2.nabble.com/Qpid-Java-Broker-Remove-alternate-exchange-tp7660147p7660212.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

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


Re: [Qpid Java Broker] Remove alternate exchange

Posted by Rob Godfrey <ro...@gmail.com>.
On 7 March 2017 at 14:25, Vavricka <va...@gmail.com> wrote:

> Hi,
>
>   I have two exchanges with alternate exchange set to the other exchange.
>
>  Below are the two exchanges in following format <Exchange name,Alternate
> exchange>
>
>   broadcast,broadcast_resend
>   broadcast_resend,broadcast
>
>   I am trying to remove exchange by REST API.
>
>  When I tried to remove exchange 'broadcast' Java Broker complained that
> exchange is used in another exchange as alternate exchange.
>
>   Then I tried to remove alternate exchange from exchange 'broadcast'.
>   I tried to remove alternate exchange by configured object update as
> described at
> https://qpid.apache.org/releases/qpid-java-6.1.1/java-
> broker/book/Java-Broker-Management-Channel-REST-API.html
> (section 6.3.5).
>
>   I tried to set parameters to { "alternateExchange" : "" } which failed
> with error "Cannot convert '' into a
> org.apache.qpid.server.model.Exchange<?> for attribute alternateExchange
> (Could not find object of category Exchange with name '')".
>
>
You'll need to set the to { "alternateExchange" : null } - this should
remove the alternate exchange reference, the following worked for me on an
exchange foo:

curl -X POST -H "Content-Type: application/json" -d '{ "alternateExchange"
: null }' http://localhost:8888/api/latest/exchange/default/default/foo

Hope this helps,
-- Rob


>   Then I tried to set whole exchange object. I received JSON string of
> exchange object, map it to Jackson JsonNode, remove "alternateExchange" key
> and then made configured object update of exchange with rest of exchange
> parameters. This call successfully passes, but no change is done, alternate
> exchange still persists.
>
>   Is this the correct way how to remove exchange with alternate exchange?
>
>   Vavricka
>
>
>
> --
> View this message in context: http://qpid.2158936.n2.nabble.
> com/Qpid-Java-Broker-Remove-alternate-exchange-tp7660147.html
> Sent from the Apache Qpid users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
>