On Wed, Mar 27, 2013 at 6:34 PM, Rob Godfrey <rob.j.godf...@gmail.com>wrote:

> On 27 March 2013 21:16, Rafael Schloming <r...@alum.mit.edu> wrote:
> > On Wed, Mar 27, 2013 at 11:53 AM, Keith W <keith.w...@gmail.com> wrote:
> >
>
> [..snip..]
>
> >
> >> 3. How will the application using top half API know an error has
> >> occured? What are the application's responsibilities when it learns of
> >> an error?
> >>
> >
> > The transport has an error variable which can be inspected to get more
> > information about what has happened. Also, if/when the transport is
> unbound
> > from the connection, all of the remote endpoint states will transition
> back
> > to UNINIT.
> >
> > I'm not sure how to answer what the applications responsibilities are.
> That
> > seems to depend on the application. It could just decide to shutdown with
> > an error message or it could decide to employ some sort of retry
> strategy,
> > e.g. connect to a backup service, create a new transport, and bind it to
> > the same top half. I'm not sure I'd say it has any hard and fast
> > responsibilities per/se though.
> >
> >
>
> I think the point Keith was trying to make here is that in order for a
> component to be compliant with the AMQP specification, anywhere where
> the spec says "The connection/session/link should be
> closed/ended/detached with the X error", is it the application that
> actually has responsibility for setting the local error state and
> calling the close() on the appropriate endpoint.  If it is we are
> placing a burden on the application authors to preserve AMQP
> compliance.
>

Ah, that makes sense. Thanks for clarifying. I don't recall offhand all the
places the spec says close/end/detach with an X error, but in situations
like framing errors or missing/invalid arguments required by the transport
to properly maintain state, say an out-of-sequence delivery-id, that is
something the transport would handle automatically. I expect there may be
some cases that the top half would need to initiate explicitly though, e.g.
obviously a redirect error would need to be initiated by the top half.

--Rafael

Reply via email to