Another question.

I noticed in the example frames in the stub code, that there are two
exchange declare methods:

        frame(Frame.L3, Frame.METHOD, true, true, (short) 1);
        frame(Frame.L1, Frame.METHOD, true, true, (short) 1);

The first is handled in the context of a session, and the second in the
context of a channel.

I have been trying out different ways of presenting the API for this, and
fitting a set of interfaces onto this stub code, along the lines of the
closely following the protocol idea. I had something like:

interface ExchangeClass
{
   public void exchangeDeclare(Session context, MethodExchangeDeclare);
}

So the call for the first frame was happy because it could pass in the
session that handled the method to the delegate that processes it. I ran
into problems with the second call because it was not in a session context,
but handled at the channel level.

If I can do things both inside and outside of sessions, I probably want to
do everything in a channel context, using an attached session if one is
available.

Again, this probably comes down to my 0-10 ignorance. In 0-10 can I do an
exchange declare outside of a session? Are sessions only to be used for
transactional messaging or something? If I do an exchange declare within a
session, is it transactional? that is, not visible until commit, and can be
rolled back?

Rupert

On 08/08/07, Rupert Smith <[EMAIL PROTECTED]> wrote:
>
> So the client and broker can both manage channels, without having to send
> any commands in order to do so. But there still has to be a channel object
> in the communication layer, that provides the context in which session
> open/attach takes place.
>
> Thanks, that explains it for me.
>
> Rupert
>
> On 08/08/07, Rafael Schloming <[EMAIL PROTECTED]> wrote:
> >
> > Rupert Smith wrote:
> > > So, is there a command to open or create a session, and then another
> > to
> > > attach it to a channel.
> > > + a command to open/create a channel on a connection?
> > >
> > > All I've really seen of 0-10 so far, is the amqp.0-10-preview.xml,
> > that has
> > > been checked in on trunk. That doesn't have a 'channel' class in it
> > (yet?).
> >
> > In 0-10 the term channel refers to the physical transport for a session,
> > and although at any given point a session may only be attached to a
> > single channel, over it's lifespan a session may be connected to
> > multiple channels.
> >
> > AMQP assumes that channels are purely a mechanism for multiplexing a
> > connection, so logically when a connection is established, the whole
> > range of permitted channels (0 to the negotiated MAX) are ready and
> > available for use.
> >
> > The only thing you can actually do to a channel in AMQP without a
> > session being attached to it is to either open or resume a session, so
> > at the moment at least there is no need for a channel class.
> >
> > --Rafael
> >
> >
> > >
> > > Rupert
> > >
> > > On 08/08/07, Robert Godfrey <[EMAIL PROTECTED]> wrote:
> > >> In 0-10...
> > >>
> > >> A TCP connection has many channels... (same as 0-8)
> > >>
> > >> A Session may have a lifetime that exceeds the lifetime of a single
> > >> connection.
> > >>
> > >> A session may be attached to a (single) channel.
> > >>
> > >> It may then be detached, and later re-attached to a separate channel
> > on
> > >> the
> > >> same or a different connection.
> > >>
> > >> After a Session has been detached from a channel (or after the
> > session has
> > >> been clsed) a different session may attach to that channel.
> > >>
> > >> Hope this helps,
> > >> Rob
> > >>
> > >>
> > >> On 08/08/07, Rupert Smith <[EMAIL PROTECTED]> wrote:
> > >>> Hi, I had another look at this code and have another question. I am
> > not
> > >>> particularly well versed yet with the 0-10 protocol, so this may
> > just be
> > >>> my
> > >>> ignorance. Is 'channel' in 0-8 renamed to 'session' for 0-10, and
> > >>> completely
> > >>> dropped from the 0-10 protocol? Or does 0-10 have both channels and
> > >>> sessions?
> > >>>
> > >>> Reason I ask is because the stub has connection, channel and
> > session.
> > >>> Sessions are opened on channels. Connection can have many channels,
> > but
> > >>> session and channel are always tied together 1:1.
> > >>>
> > >>> Should it be that connection can have many sessions and the session
> > open
> > >>> method is handled at the connection level?
> > >>>
> > >>> Rupert
> > >>>
> > >>> On 18/07/07, Rafael Schloming <[EMAIL PROTECTED]> wrote:
> > >>>> Here are some stubs I've been working on that describe most of the
> > >>>> communication layer. For those who like dealing directly with code,
> > >>>> please dig in. I will be following up with some UML and a higher
> > level
> > >>>> description tomorrow.
> > >>>>
> > >>>> --Rafael
> > >>>>
> > >
> >
>
>

Reply via email to