[rabbitmq-discuss] Channel.basicPublish to a non-existent exchange does not throw

Jonathan Halterman jhalterman at gmail.com
Mon Oct 21 22:38:22 BST 2013


Another comment on basicPublish failures:

It would be great if the AlreadyClosedException that results from the first
failed basicPublish gave a helpful shutdown reason such as channel.close,
reply-code 404. As it is, there's not always a way to determine why the
channel was closed without waiting for the ShutdownListener to be called
(which could be later). This is crucial as it prevents me from knowing
whether the basicPublish is something that should result in me recovering
the channel and retrying the publish, or not.

- jonathan


On Mon, Oct 21, 2013 at 1:26 PM, Jonathan Halterman <jhalterman at gmail.com>wrote:

> Yea, racy indeed. I actually don't think we need to wait on a
> ShutdownListener since the basicPublish will eventually fail with
> AlreadyClosedException. That's fine as long as the Connection isn't
> shutdown as a result, which Steve mentioned in another thread
> (AlreadyClosedException always sets hardError...) is what should happen but
> which I haven't seen. Since I don't really have a fair chance to know that
> the Channel has been closed before getting an AlreadyClosedException,
> ideally the Connection wouldn't be closed as a result.
>
> - jonathan
>
>
> On Mon, Oct 21, 2013 at 12:25 PM, Matthias Radestock <
> matthias at rabbitmq.com> wrote:
>
>> On 21/10/13 20:20, Jonathan Halterman wrote:
>>
>>> I'm guessing I have to
>>> fallback to Channel.isOpen or wait for the ShutdownListener to be called?
>>>
>>
>> That's racy. How long would you wait?
>>
>> The reason that basicPublish doesn't return an error is because doing so
>> would require waiting for a response from the server, thus making
>> basicPublish synchronous and destroying performance.
>>
>> Matthias.
>>
>> ______________________________**_________________
>> rabbitmq-discuss mailing list
>> rabbitmq-discuss at lists.**rabbitmq.com<rabbitmq-discuss at lists.rabbitmq.com>
>> https://lists.rabbitmq.com/**cgi-bin/mailman/listinfo/**rabbitmq-discuss<https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20131021/bf91bbb9/attachment.htm>


More information about the rabbitmq-discuss mailing list