On 09/09/2013 06:15 PM, Rajesh Khan wrote:
Currently I have an app call it "Sender" that creates topics using the
following string

std::string sender_string = queue_name +";{create:always, delete:always,
node:{type:topic}}";


Now I was under the impression that if the sender application closes for
some reason The Broker would delete the topics created by the sender and
all those applications that were listening to the topic would get an
exception however this is not happening. Am I missing something here ? Any
suggestions ?

The 'delete: always' is acted on only by the client. If you close the sender then it should delete the exchange underlying the topic. However if the client is killed or crashes without the sender being closed then the deletion will not be triggered.

My suggestion would be to avoid creating a separate exchange for each of these distinct topics. Use one exchange of type direct (e.g. amq.direct which already exists on each broker, or some other statically created exchange of the same type) and then within that you can have as many distinct 'topics' as you want, each identified by a distinct key.

You can do that with a simple address of the form <exchange-name>/<key-name> to both senders and receivers. This way everything cleans itself up nicely.

E.g. you could in your case use:

  std::string queue_name = ...;
  std::string sender_string = std::string("amq.topic/") + queue_name;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to