Patrik Berglund wrote:
Q2. What happen to messages sent to an exchange, that for some reason
has not (yet) been declared and bound as above. In our example the
messages just disappear.
If the exchange has not been created, the transfer to that exchange will
fail with a 404, not found exception.
However if the exchange exists (as will always be the case for
amq.direct) but there is no matching queue bound, the broker will
currently try to route the message to any defined 'alternate-exchange'
(unfortunately none is defined for amq.direct).
The spec says that if the accept-mode is explicit (and
discard-unroutable is not set), the broker should issue a reject.
Unfortunately that feature is not yet implemented.
I've created a Jira for that [1]. I'm afraid its probably a bit late to
get that in for M4, but I'll work on getting that in as soon as the
feature freeze is lifted.
The workaround in the meantime would be to use your own exchange
instance (not amq.direct) with an alternate-exchange defined, and have
the publisher bind a queue to that alternate exchange and subscribe to
it so that it at least gets notified of messages that don't get routed.
(There is an example for this in the 0-10 tests if its of interest).
[1] https://issues.apache.org/jira/browse/QPID-1490