You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by James Mansion <ja...@mansionfamily.plus.com> on 2009/03/18 21:12:56 UTC

AMQP 1.0

I notice that just as I start to try to understand the implementation,
the AMQP 1.0 spec is 'all change'.  Well, significantly so it seems.

The current codebase doesn't seem entirely seperated between
the 'how' and the 'what' of the implementation - its not clear
how much will carry over into a 1.0 world: even the SSL
support is quite different it seems and the whole design seems
to 'follow on' from flow control.  Which is fair - I don't think
you can retrofit it - and I've tried, elsewhere.

What's the plan for the 1.0 implementation - is there a design
document or implementation plan?  Who is doing it?

How much of the existing infrastructure will be revisited?

James


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Gordon Sim <gs...@redhat.com>.
James Mansion wrote:
> Gordon Sim wrote:
>> Another important aspect is ensuring that adding support for 1.0 
>> doesn't break previously supported versions.
> How important is that, really?  There is no version overlap in the Java 
> and C++ brokers currently.  You aren't at v1.0 yet, of AMQP or QPid.

For me it is essential.

> Is anyone actually in production?

Yes.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by James Mansion <ja...@mansionfamily.plus.com>.
Gordon Sim wrote:
> For me the first part of the process is a protocol independent API and 
> some thinking around how to support multiple protocols in the broker 
> (allowing messages published over one protocol to be delivered over 
> another etc).
You mean an internal support API into which the 1.0 and 0.10 bits etc 
can be plugged?
>
> Another important aspect is ensuring that adding support for 1.0 
> doesn't break previously supported versions.
How important is that, really?  There is no version overlap in the Java 
and C++ brokers currently.  You aren't at v1.0 yet, of AMQP or QPid.

Is anyone actually in production?

> Thank you very much for investing your time in the project, it is 
> great to have your interest!
You could read to much into it.  I'm trying to warn that my interest 
isn't realistically going to result in coding.  I can think about 
things, comment, and play.  But I can't contribute in a 'show me the 
code' way.  Some projects can't accomodate that.  I can see why there is 
a preference for action rather than bike-shed design, but it does limit 
the sort of contribution that people can make - after all, even a 
prioritisation of features from potential users is a contribution at 
some level.

James


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Gordon Sim <gs...@redhat.com>.
James Mansion wrote:
> Gordon Sim wrote:
>> Based on past experience I think its best to wait until the final spec 
>> is actually published before getting too concerned about an 
>> implementation plan.
> Its not long 'til then though - but I was actually more interested in 
> what the process will be, and who will manage and execute it.

For me the first part of the process is a protocol independent API and 
some thinking around how to support multiple protocols in the broker 
(allowing messages published over one protocol to be delivered over 
another etc).

Another important aspect is ensuring that adding support for 1.0 doesn't 
break previously supported versions.

> Is this likely to be a 'show me the code' effort, or a 'show me the 
> requirement, show me the plan, show me the design, show me the 
> resourcing, show me the code' sort of thing?

At the broadest level the requirement will be the 1.0 spec, obviously 
there may be parts that can be attacked incrementally adding support for 
optional or less commonly used features after the core is in place etc.

I imagine that there will be some discussion nearer the time about how 
to break up the tasks and who does what. I suspect the details will vary 
by language and with the amount of interest shown.

I myself plan to spend some time in the coming weeks thinking about the 
API question and will be posting my thoughts and comments to the list 
along with any patches that help explain the ideas. We have a great 
group of people on this list and the user list and hopefully we can all 
feed in ideas and get a very satisfactory result.

We are now in the closing down stages of the 0.5 release. Ideally the 
next release will include a protocol independent API in all supported 
languages. Once that is out then hopefully the final 1.0 AMQP spec will 
have been published and steps towards that can be discussed.

> Qpid isn't entirely a 'spare time' project is it?  Who does the heavy 
> lifting?

There are now many active commiters from different organisations (see 
http://cwiki.apache.org/confluence/display/qpid/People).

> (It *is* clearly spare time and 'for interest' for me - I've been 
> playing while commuting and that won't change.)

Thank you very much for investing your time in the project, it is great 
to have your interest!


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by James Mansion <ja...@mansionfamily.plus.com>.
Gordon Sim wrote:
> Based on past experience I think its best to wait until the final spec 
> is actually published before getting too concerned about an 
> implementation plan.
Its not long 'til then though - but I was actually more interested in 
what the process will be, and who will manage and execute it.

Is this likely to be a 'show me the code' effort, or a 'show me the 
requirement, show me the plan, show me the design, show me the 
resourcing, show me the code' sort of thing?

Qpid isn't entirely a 'spare time' project is it?  Who does the heavy 
lifting?

(It *is* clearly spare time and 'for interest' for me - I've been 
playing while commuting and that won't change.)

James


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by John O'Hara <jo...@gmail.com>.
Completely agree there needs to be more stability before folk dive into the
code.
The core issue will be how to implement "Exchanges" as "Queues + Links";
which is the intention of 1.0.  Exchange is no longer a first class concept
in 1.0.

1.0 leaves much more freedom as how you do the implementation of these
things - esp. optimisations.

Rafi, Rob and me should do a doc on how that's meant to work for people
migrating (any) implementation to 1.0.

Glad to see there is interest!
Cheers
John



2009/3/18 Gordon Sim <gs...@redhat.com>

> James Mansion wrote:
>
>> What's the plan for the 1.0 implementation - is there a design
>> document or implementation plan?  Who is doing it?
>>
>
> Based on past experience I think its best to wait until the final spec is
> actually published before getting too concerned about an implementation
> plan.
>
> I think, as has been discussed on this list recently, that getting some
> higher level, protocol-independent APIs for those languages that don't
> currently have them is a necessary first step and one that will be valuable
> regardless.
>
> The broker has some limited support for multiple protocols at present, but
> they are really the remnants of upgrading from 0-9 'wip' to one version of
> 0-10 and then onto the final 0-10 without breaking the build and test
> suites. I think some thinking and design around improving that in general
> terms would also be a valuable step forwards.
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>
>

Re: AMQP 1.0

Posted by Aidan Skinner <ai...@apache.org>.
On Thu, Mar 19, 2009 at 1:13 PM, Robert Godfrey <ro...@gmail.com> wrote:
> 2009/3/19 Aidan Skinner <ai...@apache.org>:
>> On Wed, Mar 18, 2009 at 8:26 PM, Gordon Sim <gs...@redhat.com> wrote:
>>
>>> I think, as has been discussed on this list recently, that getting some
>>> higher level, protocol-independent APIs for those languages that don't
>>> currently have them is a necessary first step and one that will be valuable
>>> regardless.
>>
>> I think this is going to be really helpful for client applications,
>> most of which don't really want to be tied to protocol versions.
>>
>> The Java client uses JMS for this to an extent, but we still need a
>> way of exposing AMQP specific things in ways that are as version
>> independent as possible (such as the mandatory flag). I've been
>> kicking around the idea of something like this:

> I think that we may find that from a Java/JMS perspective the more
> profitable route will be to separate out a 1.0 implementation from the

Are you talking about the interfaces here, or at a deeper level?
That's sort of how 0-10 and 0-9/0-8 are implemented in the client
currently, and I'm not convinced that the cut-n-shunt model works all
that well. It may just be a matter of the process that occured there
though, and with some refcatoring could well be the way to go.

> legacy code.  Defining an AMQSession interface which exposes AMQP
> (1-0) semantics is still my preferred mechanism. I'm unsure whether
> such an interface would have any direct relationship to JMS Session
> however.

It would seem sensible for the JMSSession to sit on top of AMQSession
and then dispatch on the type of the session where it needs to do
something different for earlier AMQP versions.

I'm not sure how much backward compatibility we need to provide for
existing users who are accessing the AMQP extensions. We've made some
effort to do so so far, but the move to 1-0 may present a good
opportunity and reason for breaking API compatibility. We'd only get
one chance at this for a while though, so we'd need to get it right.

>> There are still some significant details to work out, particularly
>> around administration and translating messages from one protocol
>> version to another. Clearly nirvana here is for a 0-8 client to be
>> able to connect, send a message and have it go to 0-9, 0-10 and 1-0
>> clients and it Just Works. Similarly, persistence plugins shouldn't
>> have to care about the type of message that they get - they should be
>> able to persist any of them.
>
> Once we have completed the core of the AMQP1-0 specification then
> myself, Rafi, John and others from the AMQP Working Group will be
> working on documenting such things as
>
> * How to map JMS to AMQP in a portable way,
> * How to send AMQP0-8/0-9/0-10 Messages ove AMQP1-0 Networks, and
> * How to emulate the behaviour of exchanges using Links and Queues

Those would be Really Helpful, particularly the first two if we're
going to have meaningful interop with other AMQP vendors.

- Aidan
-- 
Apache Qpid - World Domination through Advanced Message Queueing
http://qpid.apache.org

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Robert Godfrey <ro...@gmail.com>.
2009/3/19 Aidan Skinner <ai...@apache.org>:
> On Wed, Mar 18, 2009 at 8:26 PM, Gordon Sim <gs...@redhat.com> wrote:
>
>> I think, as has been discussed on this list recently, that getting some
>> higher level, protocol-independent APIs for those languages that don't
>> currently have them is a necessary first step and one that will be valuable
>> regardless.
>
> I think this is going to be really helpful for client applications,
> most of which don't really want to be tied to protocol versions.
>
> The Java client uses JMS for this to an extent, but we still need a
> way of exposing AMQP specific things in ways that are as version
> independent as possible (such as the mandatory flag). I've been
> kicking around the idea of something like this:
>
> JMSSession -> AMQSession -> AMQ_[ver]_session
>
> With only things that are supported by all version fo AMQP in
> AMQSession. This does lead to a couple of problems though, such as
> features that are in all but one version of spec.
>
> The other option I was considering was something like
>
> JMSSession -> AMQSession -> AMQPre10Session -> AMQ010Session
>
> but I think that may be over engineering for the sake of over engineering.

I think that we may find that from a Java/JMS perspective the more
profitable route will be to separate out a 1.0 implementation from the
legacy code.  Defining an AMQSession interface which exposes AMQP
(1-0) semantics is still my preferred mechanism. I'm unsure whether
such an interface would have any direct relationship to JMS Session
however.

>
>> The broker has some limited support for multiple protocols at present, but
>> they are really the remnants of upgrading from 0-9 'wip' to one version of
>> 0-10 and then onto the final 0-10 without breaking the build and test
>> suites. I think some thinking and design around improving that in general
>> terms would also be a valuable step forwards.
>
> The java server supports 0-8 and 0-9, but they're really additional
> protocol dialects. 0-10 and, in particular, 1-0 have somewhat more
> substantial semantic differences. In order to properly support them I
> think they key is to have as modular a server as possible.
>
> I've written up some of the improvements to the java server I think
> should be made here:
> http://qpid.apache.org/java-broker-modularisation.html (that page
> needs to be updated a little since some of the works been done in
> 0.5).
>
> The idea is that the core of the server does the basic work of taking
> a message, putting it on disk, putting on a queue, taking it from a
> queue and giving it to the client. The details of that, such as how
> what message goes on what queue before being delivered to a consumer
> and the protocol used to transfer messages, are implemented by 1 or
> more plugins which contribute queues, protocol packs, admin wiring
> etc.
>
> There are still some significant details to work out, particularly
> around administration and translating messages from one protocol
> version to another. Clearly nirvana here is for a 0-8 client to be
> able to connect, send a message and have it go to 0-9, 0-10 and 1-0
> clients and it Just Works. Similarly, persistence plugins shouldn't
> have to care about the type of message that they get - they should be
> able to persist any of them.

Once we have completed the core of the AMQP1-0 specification then
myself, Rafi, John and others from the AMQP Working Group will be
working on documenting such things as

* How to map JMS to AMQP in a portable way,
* How to send AMQP0-8/0-9/0-10 Messages ove AMQP1-0 Networks, and
* How to emulate the behaviour of exchanges using Links and Queues

Hope this helps,
Rob

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Aidan Skinner <ai...@apache.org>.
On Fri, Mar 20, 2009 at 1:13 PM, Rafael Schloming <ra...@redhat.com> wrote:

> My employer (Red Hat) has a growing number of both internal users and
> customers that are using Qpid with heterogeneous applications implemented in
> 2 or 3 different languages. This makes them much more Qpid centric than JMS
> centric, and I think this is certainly an important class of user that we
> must consider going forward. As of now though I don't see there being any
> huge technical issues in making both JMS centric and Qpid centric users
> happy.

Oh, totally. Heterogenous environments are clearly an important use
case, and definitely one of the more interesting ones.

I don't see JMS as being 'legacy' API really, and I really don't see
much point in trying to re-invent the wheel for AMQP. JMS is
imperfect, but it's quite well known and we'd have to offer it anyway.

> It's definitely on our roadmap to build a lightweight C client suitable for
> SWIG. We're at the limit of what we can support in terms of maintenance with
> native clients in C++, Java, python, ruby, and .net, so we're definitely

+1

- Aidan (who never quite got the (hang (of (lisp)))
-- 
Apache Qpid - World Domination through Advanced Message Queueing
http://qpid.apache.org

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Rafael Schloming <ra...@redhat.com>.
James Mansion wrote:
> Aidan Skinner wrote:
>> The Java client uses JMS for this to an extent, but we still need a
>> way of exposing AMQP specific things in ways that are as version
>> independent as possible (such as the mandatory flag).
> I can see that there is value in reaching out to developers who have JMS 
> code or who
> wish to retain JMS capability, *please* don't hobble Java users who want 
> the full-fat
> qpid experience by making everything fit with JMS.  Case in point: the 
> Java client for
> postgres is annoyingly limited as soon as you want to receive async 
> notifications and
> so on.  I would much prefer the most efficient and direct mapping to 
> AMQP facilities
> possible in each language, and an adapter to legacy APIs.

My employer (Red Hat) has a growing number of both internal users and 
customers that are using Qpid with heterogeneous applications 
implemented in 2 or 3 different languages. This makes them much more 
Qpid centric than JMS centric, and I think this is certainly an 
important class of user that we must consider going forward. As of now 
though I don't see there being any huge technical issues in making both 
JMS centric and Qpid centric users happy.

[snip]

> Perhaps something to consider is trying to make the C/C++ client as 
> lightweight as
> possible and having a reference SWIG wrapper.  In this case I would 
> ideally look
> for the client to be 'passive' and allow the host to do raw connection 
> establishment
> and raw IO so it acts as a protocol engine and avoid issues of event 
> loop integration
> and so on.

It's definitely on our roadmap to build a lightweight C client suitable 
for SWIG. We're at the limit of what we can support in terms of 
maintenance with native clients in C++, Java, python, ruby, and .net, so 
we're definitely going to be looking to reduce the maintenance burden 
with a common C implementation for the interpreted languages. This is 
really a prerequisite to building out support in any of the remaining 
popular languages (e.g. perl, PHP).

--Rafael


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Jonathan Robie <jo...@redhat.com>.
Robert Godfrey wrote:
> 2009/3/20 Jonathan Robie <jo...@redhat.com>:
>   
>> James Mansion wrote:
>>     
>>> There are lots of JMS implementations.  My own interest in AMQP is largely
>>> driven
>>> by it NOT being JMS - so there is a chance that my C#, Python and C++ code
>>> can be first class citizens.  Clearly other people will have different
>>> priorities.
>>>       
>> Interop across languages and platforms is clearly an important design
>> criterion. I don't think anyone disagrees with you here.
>>
>> Our Java JMS clients interoperate with clients in Python and C++. There's
>> clearly demand for Java JMS support. I would like to also see a Java client
>> that more directly reflects AMQP, as our clients in other languages do.
>>     
>
> I must admit see no real reason for this *unless*
> 1) there is defined some common AMQP API that is not JMS and is
> blessed by the AMQP working group, or
> 2) there are significant features of AMQP than cannot be comfortably
> accessed through JMS or obvious extensions.
>   

I agree that this only makes sense if we do (1). I would like to see a 
common set of objects and methods that are supported in all APIs, so 
that anyone who knows how to program Qpid in one language has a pretty 
good idea how to do it in another language. I think some of the 
differences between our Python and C++ API are gratuitous, and 
frustrating when I write code in both languages.

Jonathan

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Mark Atwell <ma...@gmail.com>.
Porting between JMS implementations is, by definition, possible.

Unfortunately there is the very practical problem that most developers
don't really read or understand the spec. - especially the subtleties.
They tend to write to a simple paradigm that seems to make sense and
the implementation that they happen to have in their hands at that
moment *appears* to - and sometimes does - adhere to - see below. The
written-language of the author and the reader have to be on the top of
their game to understand *exactly* what is being conveyed... and
sometimes: why you should care! I still come across the odd paragraph
(not just in the JMS spec.) where I'm thinking "This looks like it's
meant to be important - teasing out some subtlety - but I can't for
the life of me, see what it's trying to say that is different or
important... Or is it just a restatement - possibly to 'pad out' the
book?"

And sometimes even the subtleties aren't obviously surfaced! I recall
a few years ago: poring for several minutes over one particular
paragraph (and might have even been a sentence) in the spec. about
routing rules and ordering over different topics/destinations. IIRC
(don't write your code based on what I'm about to write here! :o) the
implementation has the latitude to route traffic on different topics -
even between the same source and destination - separately and
therefore messages can arrive out-of-order w.r.t. each other. In
practice many implementations don't do this, but what do you know? But
the implementation that was being ported to did! And of course, it
(out-of-order delivery) didn't actually happen very often. In this
particular case it was further masked by a 'slow' sender client that
very rarely got its act together and sent two messages in quick enough
succession!

The software industry is littered with such examples. For those who
can remember back: How many years did it take C (let alone C++!) to
clarify *all* the standards and subtleties, and the compiler writers
themselves to understand and implement them correctly and the
developers to fix their now-broken (some would perhaps correctly argue
'always-broken') code? It's probably still going on somewhere... This
is why the Java Language and JVM Specs. are so much better than what
we had before - they define rules for almost everything - both the
language and the run-time environment.

And then, just when you think (hope!) I'm going to stop: What about
the reasons for using a particular implementation? Whilst cost is
often a driver, what about those 'extra' features or even
implementation 'profile'? For example: "It's backed by (it stores data
in) Oracle and we're an Oracle shop and therefore can get it to fit
our DR approach!" or "It was designed for low latency / deals with
slow clients over the WAN / Internet." - all within the letter and
even the spirit of the spec. The points about JDBC or even Hibernate
are similar. Whilst one can get functional portability, the supposed
non-functionals are often even more important.

BTW, I'm really not a 'buyer' of the concept of 'non-functionals' -
especially performance - but I'll save that rant for another day...

Regards to All!

Mark

On Thu, Mar 26, 2009 at 10:41 PM, Robert Greig <ro...@gmail.com> wrote:
> 2009/3/26 James Mansion <ja...@mansionfamily.plus.com>:
>
>> I'm surprised about that.  Do you think jdbc provides similar portability?
>>  The
>> API might be pretty common, but there is no way on earth that makes
>> non-trivial
>> code portable between Sybase and PostgreSQL, for example - and nor even
>> does sticking hibernate on top to generate SQL for you help either, for that
>> matter.
>> In that particular case the Big Deal will be the concurrency model more than
>> anything else, followed by subtleties relating to careful use of
>> update-in-place
>> and index coverage (from the perspective of starting with Sybase anyway).
>
> I don't think JDBC is really the same - as you say the SQL differences
> and differences in locking model and the like are often significant
> between database vendors.
>
> Although there are clearly differences between messaging middleware
> products, my experience is that many applications only use the basic
> JMS API and don't rely on subtle semantics of the underlying broker
> implementation.
>
>> I would have thought that differences in the semantics of message ack
>> batching,
>> fan-out, authentication, subscription etc will be subtle but ultimately
>> irreconcilable,
>> and the ability to use a familiar JMS API will be a portability benefit in
>> theory more
>> than in practice.
>
> Differences in areas such as authentication are certainly expected
> (and not really covered by the JMS spec) but only affect a tiny part
> of the code. Most apps can use the JMS transaction model or message
> ack model.
>
> I have ported apps between a few major messaging providers with success.
>
>> Time will tell.  Clearly there is a body that want JMS with an ability to
>> get at
>> AMQP facilities, and a body that want to write an AMQP application that
>> happens to use Java.
>
> As I've argued before in this forum and elsewhere, an "extended JMS"
> model can offer a good path for people who want to use JMS and
> occasionally exploit a JMS-specific feature.
>
> RG
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>
>

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Robert Greig <ro...@gmail.com>.
2009/3/26 James Mansion <ja...@mansionfamily.plus.com>:

> I'm surprised about that.  Do you think jdbc provides similar portability?
>  The
> API might be pretty common, but there is no way on earth that makes
> non-trivial
> code portable between Sybase and PostgreSQL, for example - and nor even
> does sticking hibernate on top to generate SQL for you help either, for that
> matter.
> In that particular case the Big Deal will be the concurrency model more than
> anything else, followed by subtleties relating to careful use of
> update-in-place
> and index coverage (from the perspective of starting with Sybase anyway).

I don't think JDBC is really the same - as you say the SQL differences
and differences in locking model and the like are often significant
between database vendors.

Although there are clearly differences between messaging middleware
products, my experience is that many applications only use the basic
JMS API and don't rely on subtle semantics of the underlying broker
implementation.

> I would have thought that differences in the semantics of message ack
> batching,
> fan-out, authentication, subscription etc will be subtle but ultimately
> irreconcilable,
> and the ability to use a familiar JMS API will be a portability benefit in
> theory more
> than in practice.

Differences in areas such as authentication are certainly expected
(and not really covered by the JMS spec) but only affect a tiny part
of the code. Most apps can use the JMS transaction model or message
ack model.

I have ported apps between a few major messaging providers with success.

> Time will tell.  Clearly there is a body that want JMS with an ability to
> get at
> AMQP facilities, and a body that want to write an AMQP application that
> happens to use Java.

As I've argued before in this forum and elsewhere, an "extended JMS"
model can offer a good path for people who want to use JMS and
occasionally exploit a JMS-specific feature.

RG

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by James Mansion <ja...@mansionfamily.plus.com>.
Robert Greig wrote:
> JMS may not be perfect but I can just about guarantee that most of the
> apps written in Java for Qpid using the JMS API will work just fine
> when we release a Qpid broker than supports the 1-0 protocol. Who's
> feeling confident about Python??
>   
I'm surprised about that.  Do you think jdbc provides similar 
portability?  The
API might be pretty common, but there is no way on earth that makes 
non-trivial
code portable between Sybase and PostgreSQL, for example - and nor even
does sticking hibernate on top to generate SQL for you help either, for 
that matter.
In that particular case the Big Deal will be the concurrency model more than
anything else, followed by subtleties relating to careful use of 
update-in-place
and index coverage (from the perspective of starting with Sybase anyway).

I would have thought that differences in the semantics of message ack 
batching,
fan-out, authentication, subscription etc will be subtle but ultimately 
irreconcilable,
and the ability to use a familiar JMS API will be a portability benefit 
in theory more
than in practice.

Time will tell.  Clearly there is a body that want JMS with an ability 
to get at
AMQP facilities, and a body that want to write an AMQP application that
happens to use Java.




---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Robert Greig <ro...@gmail.com>.
2009/3/20 Robert Godfrey <ro...@gmail.com>:

>> Our Java JMS clients interoperate with clients in Python and C++. There's
>> clearly demand for Java JMS support. I would like to also see a Java client
>> that more directly reflects AMQP, as our clients in other languages do.
>>
>
> I must admit see no real reason for this *unless*
> 1) there is defined some common AMQP API that is not JMS and is
> blessed by the AMQP working group, or
> 2) there are significant features of AMQP than cannot be comfortably
> accessed through JMS or obvious extensions.
>
> Writing proprietary APIs for basic messaging functionality seems like
> a giant step backwards.

Completely agree 110%. (As regular readers of this column will know :-)).

> It seems that in the other languages we are moving towards a more
> protocol-neutral API.  I don't see any reason to move in the reverse
> direction for Java.

Yes surely the changes between 0-10 and 1-0 have illustrated to anyone
who was still not convinced that APIs that are not protocol neutral
are a complete nightmare from a backwards compatibility perspective.

JMS may not be perfect but I can just about guarantee that most of the
apps written in Java for Qpid using the JMS API will work just fine
when we release a Qpid broker than supports the 1-0 protocol. Who's
feeling confident about Python??

RG

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Robert Godfrey <ro...@gmail.com>.
2009/3/20 Jonathan Robie <jo...@redhat.com>:
> James Mansion wrote:
>>
>> There are lots of JMS implementations.  My own interest in AMQP is largely
>> driven
>> by it NOT being JMS - so there is a chance that my C#, Python and C++ code
>> can be first class citizens.  Clearly other people will have different
>> priorities.
>
> Interop across languages and platforms is clearly an important design
> criterion. I don't think anyone disagrees with you here.
>
> Our Java JMS clients interoperate with clients in Python and C++. There's
> clearly demand for Java JMS support. I would like to also see a Java client
> that more directly reflects AMQP, as our clients in other languages do.
>

I must admit see no real reason for this *unless*
1) there is defined some common AMQP API that is not JMS and is
blessed by the AMQP working group, or
2) there are significant features of AMQP than cannot be comfortably
accessed through JMS or obvious extensions.

Writing proprietary APIs for basic messaging functionality seems like
a giant step backwards.

It seems to me that the main motivation to have an API in Java that is
directly based on AMQP is to make the example code between languages
similar.  Frankly as a Java developer I think knowing how to program
to the JMS API is fair... asking me to learn an API for AMQP which is
standardized across vendors, but isn't JMS, seems a little annoying
but if it brings me great benefits I can probably live with it.
Asking me to learn an API which is completely specific to Qpid/Java
seems wilfully perverse.

It seems that in the other languages we are moving towards a more
protocol-neutral API.  I don't see any reason to move in the reverse
direction for Java.

-- Rob

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Jonathan Robie <jo...@redhat.com>.
James Mansion wrote:
> There are lots of JMS implementations.  My own interest in AMQP is 
> largely driven
> by it NOT being JMS - so there is a chance that my C#, Python and C++ 
> code
> can be first class citizens.  Clearly other people will have different 
> priorities.

Interop across languages and platforms is clearly an important design 
criterion. I don't think anyone disagrees with you here.

Our Java JMS clients interoperate with clients in Python and C++. 
There's clearly demand for Java JMS support. I would like to also see a 
Java client that more directly reflects AMQP, as our clients in other 
languages do.

Jonathan

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by James Mansion <ja...@mansionfamily.plus.com>.
Aidan Skinner wrote:
> The Java client uses JMS for this to an extent, but we still need a
> way of exposing AMQP specific things in ways that are as version
> independent as possible (such as the mandatory flag).
I can see that there is value in reaching out to developers who have JMS 
code or who
wish to retain JMS capability, *please* don't hobble Java users who want 
the full-fat
qpid experience by making everything fit with JMS.  Case in point: the 
Java client for
postgres is annoyingly limited as soon as you want to receive async 
notifications and
so on.  I would much prefer the most efficient and direct mapping to 
AMQP facilities
possible in each language, and an adapter to legacy APIs.

Sun's failure to consider interoperability with other language 
environments continues
to haunt it. :-(  There is much to learn from ActiveMQ interoperability.

There are lots of JMS implementations.  My own interest in AMQP is 
largely driven
by it NOT being JMS - so there is a chance that my C#, Python and C++ code
can be first class citizens.  Clearly other people will have different 
priorities.  I'm
interested to know why a (happy) JMS user would be interested in AMQP 
though:
JMS has things which are handy in Java but will be awkward in a 
heterogeneous
system.

Perhaps something to consider is trying to make the C/C++ client as 
lightweight as
possible and having a reference SWIG wrapper.  In this case I would 
ideally look
for the client to be 'passive' and allow the host to do raw connection 
establishment
and raw IO so it acts as a protocol engine and avoid issues of event 
loop integration
and so on.

James


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Aidan Skinner <ai...@gmail.com>.
On Thu, Mar 19, 2009 at 3:06 PM, Robert Godfrey <ro...@gmail.com> wrote:

> is entirely appropriate.  Best would be if AMQMessage was defined by
> the AMQP Working Group and provided in an org.amqp package...

That would be Very Helpful indeed, although quite a big task. ;)

We could work on it on org.apache.qpid.amqp and try to sync up with
other vendors if other people were interested.

> On the interfaces side, what I was saying was that AMQMessage need not
> extend JMS Message, etc...  Our *implementation* of a Message class
> would likely implement both.

Ah, ok. Gotcha. This seems sensible.

> My main concern would be if there were any legal implications to
> publishing a set of AMQP interfaces that depended on the JMS ones...

Possibly, though IANAL nor do I play one on tv. It's probably not
desireable in any case, hard casts out of JMS are probably
semantically clearer.

- Aidan
-- 
Apache Qpid - World Domination through Advanced Message Queueing
http://qpid.apache.org

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Rafael Schloming <ra...@redhat.com>.
Robert Godfrey wrote:
> [.. snip ..]
> 
>> I tend to dislike the casting approach since if you need to make more than
>> one or two calls it becomes quite cumbersome and people then inevitably just
>> declare their variables to be of the non JMS type and then it's unclear
>> which calls are pure JMS and which aren't.
>>
>> I also think it's a bit of a hack to be required to cast as part of an API.
>> It's difficult to tell whether you're casting into an approved part of the
>> API or whether you're casting to some random implementation specific
>> interface that the object just happens to implement.
> 
> That is why I advocate an *interface* rather than casting into
> implementation classes.

An interface if restricted to only permit features not accessible 
through vanilla JMS would certainly help, but I still think casting as 
part of the API unacceptably blurs the boundaries of the API. There is 
no way to tell what types you're allowed to cast and to which interfaces 
you're allowed to cast.

>>> Using custom headers hides dependencies and makes things compile (or
>>> link) even when they should fail.
>> This is only true if you hardcode your header values rather than using some
>> API to set them. Using constants will cause a compile time failure, and
>> using a decorator will cause both compile and link failures.
> 
> It will cause a compile time failure but not a run time failure.  You
> can have the jar in your classpath without it being the JMS client
> that you are actually using.

Yes, I was considering that a feature. It doesn't matter whether you 
have an 0-8, 0-9, 0-10, or 1-0 JMS message underneath, you still have 
access to the same broker extension. I would probably add an assertion 
based on the destination, broker vendor/version, etc to verify that the 
broker and recipient will understand what is being sent.

>> I think there are different sorts of AMQP specific behavior that we need to
>> think about here. For example I would make a distinction between AMQP or
>> Qpid specific broker features, and AMQP or Qpid specific client features. I
>> think accessing AMQP or Qpid specific broker features through a well defined
>> set of message headers is probably a reasonable way to go, and there are a
>> variety of ways to set these headers that provide differing levels of
>> compile and/or runtime protection to the application. But really for
>> accessing broker features there is no need to tie anything to the specific
>> JMS implementation in question, e.g.:
>>
>> Message msg = ..;
>> QpidMessage qmsg = new QpidMessage(msg);
>> qmsg.setFoo(); // equivalent to msg.setStringProperty(QpidHeaders.FOO,
>> "bar") which is in turn equivalent to
>> msg.setStringProperty("org.apache.qpid.foo", "bar")
> 
> I think the JMS Properties should be used as intended - that is as a
> way of adding to the end-to-end properties of the message (payload)
> being sent.  If the extension is on the broker, and is triggered by
> such a property then setting the property is the appropriate
> mechanism.  However if the AMQP extension is something that should be
> interpreted by the client then I do not believe that we should be
> using such an ugly hack.

I wasn't suggesting using headers for controlling client local behavior. 
I think actually we should take appropriate advantage of the destination 
abstraction for that.

> I understand that you have a pathalogical hatred of casts.  The java
> syntax is certainly less than ideal.  However where we are depending
> on AMQP specific behaviour it should be called out.

It's not casts I dislike. It's casting as part of an API that I dislike 
since it makes the API unnecessarily blurry. It's also quite trivial to 
avoid assuming you don't have a pathological hatred of static methods. ;)

> My feeling is that given where we are taking the 1-0 spec there is
> likely to be *much* less of this required.
> 
> The only examples I can think of off-hand on messages might be audit
> trails or signatures...

Yes, I think most extensions are actually likely to be more Qpid 
specific than AMQP specific as well.

>> For AMQP or Qpid specific behavior related to the client implementation,
>> e.g. acking behavior, prefetch behavior, etc, I think this is something of a
>> different story, and I would probably take these features on a case by case
>> basis. I suspect it's probably not an either/or situation and we'll want
>> both configuration for people deploying pre-existing vanilla JMS apps, as
>> well as API for people writing stuff from scratch or "porting" to qpid.
>>
> 
> My view is that you should try to avoid to using *any* AMQP or Qpid
> specific extensions.  Where they are to be relied upon I (as an
> architect or manager of a development team) want those dependencies to
> be called out *very* explicitly.  The use of magic headers etc. is the
> sort of thing that makes porting between message providers *very* hard
> (been there done that).

I wasn't suggesting using magic headers for this sort of thing. I think 
we can do most of what we need to through the destination abstraction.

> Hopefully most AMQP/QPID extensions can be isolated in cofiguration
> rather than code...

I think the destination abstraction is a reasonably useful way to do 
this for most things. It gives us one mechanism that is mostly used via 
configuration but can also be used through code as well via 
createQueue(...) and friends.

--Rafael


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Gordon Sim <gs...@redhat.com>.
Robert Godfrey wrote:
> Hopefully most AMQP/QPID extensions can be isolated in cofiguration
> rather than code

Well said, sir!

Rafael Schloming wrote:
 > I think we can do most of what we need to through the destination
 > abstraction.

Well said, again!

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Rafael Schloming <ra...@redhat.com>.
Sorry to send twice. Our mail server is being flaky and appeared to drop 
the first one.

--Rafael

Rafael Schloming wrote:
> Robert Godfrey wrote:
>> [.. snip ..]
>>
>>> I tend to dislike the casting approach since if you need to make more 
>>> than
>>> one or two calls it becomes quite cumbersome and people then 
>>> inevitably just
>>> declare their variables to be of the non JMS type and then it's unclear
>>> which calls are pure JMS and which aren't.
>>>
>>> I also think it's a bit of a hack to be required to cast as part of 
>>> an API.
>>> It's difficult to tell whether you're casting into an approved part 
>>> of the
>>> API or whether you're casting to some random implementation specific
>>> interface that the object just happens to implement.
>>
>> That is why I advocate an *interface* rather than casting into
>> implementation classes.
> 
> An interface if restricted to only permit features not accessible
> through vanilla JMS would certainly help, but I still think casting as
> part of the API unacceptably blurs the boundaries of the API. There is
> no way to tell what types you're allowed to cast and which interfaces
> you're allowed to cast it to.
> 
>>>> Using custom headers hides dependencies and makes things compile (or
>>>> link) even when they should fail.
>>> This is only true if you hardcode your header values rather than 
>>> using some
>>> API to set them. Using constants will cause a compile time failure, and
>>> using a decorator will cause both compile and link failures.
>>
>> It will cause a compile time failure but not a run time failure.  You
>> can have the jar in your classpath without it being the JMS client
>> that you are actually using.
> 
> Yes, I was considering that a feature. It doesn't matter whether you
> have an 0-8, 0-9, 0-10, or 1-0 JMS message underneath, you still have
> access to the same broker extension. I would probably add an assertion
> based on the destination, broker vendor/version, etc to verify that the
> broker and recipient will understand what is being sent.
> 
>>> I think there are different sorts of AMQP specific behavior that we 
>>> need to
>>> think about here. For example I would make a distinction between AMQP or
>>> Qpid specific broker features, and AMQP or Qpid specific client 
>>> features. I
>>> think accessing AMQP or Qpid specific broker features through a well 
>>> defined
>>> set of message headers is probably a reasonable way to go, and there 
>>> are a
>>> variety of ways to set these headers that provide differing levels of
>>> compile and/or runtime protection to the application. But really for
>>> accessing broker features there is no need to tie anything to the 
>>> specific
>>> JMS implementation in question, e.g.:
>>>
>>> Message msg = ..;
>>> QpidMessage qmsg = new QpidMessage(msg);
>>> qmsg.setFoo(); // equivalent to msg.setStringProperty(QpidHeaders.FOO,
>>> "bar") which is in turn equivalent to
>>> msg.setStringProperty("org.apache.qpid.foo", "bar")
>>
>> I think the JMS Properties should be used as intended - that is as a
>> way of adding to the end-to-end properties of the message (payload)
>> being sent.  If the extension is on the broker, and is triggered by
>> such a property then setting the property is the appropriate
>> mechanism.  However if the AMQP extension is something that should be
>> interpreted by the client then I do not believe that we should be
>> using such an ugly hack.
> 
> I wasn't suggesting using headers for controlling client local behavior.
> I think actually we should take appropriate advantage of the destination
> abstraction for that.
> 
>> I understand that you have a pathalogical hatred of casts.  The java
>> syntax is certainly less than ideal.  However where we are depending
>> on AMQP specific behaviour it should be called out.
> 
> It's not casts I dislike. It's casting as part of an API that I dislike
> since it makes the API unnecessarily blurry. It's also quite trivial to
> avoid assuming you don't have a pathological hatred of static methods. ;)
> 
>> My feeling is that given where we are taking the 1-0 spec there is
>> likely to be *much* less of this required.
>>
>> The only examples I can think of off-hand on messages might be audit
>> trails or signatures...
> 
> Yes, I think most extensions are actually likely to be more Qpid
> specific than AMQP specific as well.
> 
>>> For AMQP or Qpid specific behavior related to the client implementation,
>>> e.g. acking behavior, prefetch behavior, etc, I think this is 
>>> something of a
>>> different story, and I would probably take these features on a case 
>>> by case
>>> basis. I suspect it's probably not an either/or situation and we'll want
>>> both configuration for people deploying pre-existing vanilla JMS 
>>> apps, as
>>> well as API for people writing stuff from scratch or "porting" to qpid.
>>>
>>
>> My view is that you should try to avoid to using *any* AMQP or Qpid
>> specific extensions.  Where they are to be relied upon I (as an
>> architect or manager of a development team) want those dependencies to
>> be called out *very* explicitly.  The use of magic headers etc. is the
>> sort of thing that makes porting between message providers *very* hard
>> (been there done that).
> 
> I wasn't suggesting using magic headers for this sort of thing. I think 
> the destination abstraction can be used for most of what we need here.
> 
>> Hopefully most AMQP/QPID extensions can be isolated in cofiguration
>> rather than code...
> 
> I think the destination abstraction is a reasonably useful way to do
> this for most things. It gives us one mechanism that is mostly used via
> configuration but can also be used through code as well with
> createQueue(...) and friends.
> 
> --Rafael
> 
> 
> 
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
> 

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Rajith Attapattu <ra...@gmail.com>.
On Fri, Mar 20, 2009 at 10:58 AM, Aidan Skinner <ai...@apache.org> wrote:
> On Fri, Mar 20, 2009 at 2:50 PM, Rafael Schloming <ra...@redhat.com> wrote:
>
>> Aidan Skinner wrote:
>>>
>>> On Thu, Mar 19, 2009 at 6:12 PM, Rafael Schloming <ra...@redhat.com>
>>> wrote:
>
>> or something like that. But you could do something similar with the
>> destination. Also, I wasn't necessarily thinking that you would cast inside
>> the static method, I think the decorator thing I mentioned earlier is worthy
>> of some exploration, but obviously one of the benefits of having the method
>> is we can change what it does later.
>
> This sounds like a plan to me. :)
>
>>> I'm a little confused, are we talking about client config or server
>>> config?
>>
>> I was thinking of client config, specifically what we've traditionally
>> referred to as the "binding URL", although I've never actually understood
>> why it's a URL, and it really doesn't have all that much to do with binding
>> either, particularly in a 1-0 model.
>>
>> I'm actually just thinking that text based config strings for destinations
>> can control a lot of the client behavior we care about, e.g. ack policy,
>> sync policy, prefetch, etc, and this has the benefit of being usable from
>> both a config file and from code, and it is sort of an approved extension
>> point in as much as JMS has them.
>
> That makes sense. I guess there's really two different aspects of
> portability here.
>
> There's "I want my new app to be written as portably as possible" in
> which case going for compiler-enforceable extensions probably makes
> sense.
>
> There's also "I want to port my existing app to Qpid as quickly as
> possible", in which case being able to control any AMQP or Qpid
> specifc things from config without having to change your code is
> probably much more valuable.

It is this second aspect that I was alluding too. This is exactly what
I heard from the customer interaction I had.
I agree with Rafi that we could do a lot more with destination
abstraction than what we are currently doing today.
I also agree with Rob that we should stive to support extentions (both
QPID and AMQP specific) using configuration as much as possible.
I think currrently we do handle a fair bit of extentions using the
above two methods, but certainly a lot more could be improved.

If for some reason we are unable to support a specific feature (I
don't have a good example in mind and the example of immediate flag I
used before is bad, and I believe it could be handled better via the
destination abstraction) then we could look at options like casting or
using a strategy (as rafi pointed out) such as AMQMessage m =
AMQMessage.fromJMSMessage(...) or passing flags (which does looks like
an abuse of the message properties, but could be made to be detected
at compile time by using constants instead of hard coded strings).

But I sure hope that we should be able to cover 99% of the use cases
via the destination abstraction + configuration and the last option in
only in some very rare cases.

Regards,

Rajith

> - Aidan
> --
> Apache Qpid - World Domination through Advanced Message Queueing
> http://qpid.apache.org
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>
>



-- 
Regards,

Rajith Attapattu
Red Hat
http://rajith.2rlabs.com/

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Aidan Skinner <ai...@apache.org>.
On Fri, Mar 20, 2009 at 2:50 PM, Rafael Schloming <ra...@redhat.com> wrote:

> Aidan Skinner wrote:
>>
>> On Thu, Mar 19, 2009 at 6:12 PM, Rafael Schloming <ra...@redhat.com>
>> wrote:

> or something like that. But you could do something similar with the
> destination. Also, I wasn't necessarily thinking that you would cast inside
> the static method, I think the decorator thing I mentioned earlier is worthy
> of some exploration, but obviously one of the benefits of having the method
> is we can change what it does later.

This sounds like a plan to me. :)

>> I'm a little confused, are we talking about client config or server
>> config?
>
> I was thinking of client config, specifically what we've traditionally
> referred to as the "binding URL", although I've never actually understood
> why it's a URL, and it really doesn't have all that much to do with binding
> either, particularly in a 1-0 model.
>
> I'm actually just thinking that text based config strings for destinations
> can control a lot of the client behavior we care about, e.g. ack policy,
> sync policy, prefetch, etc, and this has the benefit of being usable from
> both a config file and from code, and it is sort of an approved extension
> point in as much as JMS has them.

That makes sense. I guess there's really two different aspects of
portability here.

There's "I want my new app to be written as portably as possible" in
which case going for compiler-enforceable extensions probably makes
sense.

There's also "I want to port my existing app to Qpid as quickly as
possible", in which case being able to control any AMQP or Qpid
specifc things from config without having to change your code is
probably much more valuable.

- Aidan
-- 
Apache Qpid - World Domination through Advanced Message Queueing
http://qpid.apache.org

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by mi...@jpmorgan.com.
I HAVE ATTEMPED TO UNSUBSCRIBE FROM THIS LIST MANY TIMES BUT IT DOES NOT 
WORK.  PLEASE HELP ME GET OFF THIS LIST.

JPMORGAN RPS | +: Michael.J.Billings@jpmorgan.com | (: 816-673-3905 



Rafael Schloming <ra...@redhat.com> 
03/20/2009 09:50 AM
Please respond to
dev@qpid.apache.org


To
dev@qpid.apache.org
cc

Subject
Re: AMQP 1.0






Aidan Skinner wrote:
> On Thu, Mar 19, 2009 at 6:12 PM, Rafael Schloming <ra...@redhat.com> 
wrote:
> 
>> Robert Godfrey wrote:
> 
>>> That is why I advocate an *interface* rather than casting into
>>> implementation classes.
>> An interface if restricted to only permit features not accessible
>> through vanilla JMS would certainly help, but I still think casting as
>> part of the API unacceptably blurs the boundaries of the API. There is
>> no way to tell what types you're allowed to cast and which interfaces
>> you're allowed to cast it to.
> 
> I've always hated that about Java. I'm pretty firm on the
> bondage-and-discipline side of the strong typing argument though, and
> I realise others mileage may vary.
> 
>> access to the same broker extension. I would probably add an assertion
>> based on the destination, broker vendor/version, etc to verify that the
>> broker and recipient will understand what is being sent.
> 
> I think if we implement non-standard features we should definitely do 
this.
> 
>>> I understand that you have a pathalogical hatred of casts.  The java
>>> syntax is certainly less than ideal.  However where we are depending
>>> on AMQP specific behaviour it should be called out.
>> It's not casts I dislike. It's casting as part of an API that I dislike
>> since it makes the API unnecessarily blurry. It's also quite trivial to
>> avoid assuming you don't have a pathological hatred of static methods. 
;)
> 
> are you talking about something like public static AMQDestination
> toAMQDestination(javax.jms.Destination dest) and that does the cast
> inside AMQDestination?

I was actually thinking about the message case, e.g.:

   AMQMessage m = AMQMessage.fromJMSMessage(...)

or something like that. But you could do something similar with the 
destination. Also, I wasn't necessarily thinking that you would cast 
inside the static method, I think the decorator thing I mentioned 
earlier is worthy of some exploration, but obviously one of the benefits 
of having the method is we can change what it does later.

>>> Hopefully most AMQP/QPID extensions can be isolated in cofiguration
>>> rather than code...
>> I think the destination abstraction is a reasonably useful way to do
>> this for most things. It gives us one mechanism that is mostly used via
>> configuration but can also be used through code as well with
>> createQueue(...) and friends.
> 
> I'm a little confused, are we talking about client config or server 
config?

I was thinking of client config, specifically what we've traditionally 
referred to as the "binding URL", although I've never actually 
understood why it's a URL, and it really doesn't have all that much to 
do with binding either, particularly in a 1-0 model.

I'm actually just thinking that text based config strings for 
destinations can control a lot of the client behavior we care about, 
e.g. ack policy, sync policy, prefetch, etc, and this has the benefit of 
being usable from both a config file and from code, and it is sort of an 
approved extension point in as much as JMS has them.

--Rafael


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org





Generally, this communication is for informational purposes only
and it is not intended as an offer or solicitation for the purchase
or sale of any financial instrument or as an official confirmation
of any transaction. In the event you are receiving the offering
materials attached below related to your interest in hedge funds or
private equity, this communication may be intended as an offer or
solicitation for the purchase or sale of such fund(s).  All market
prices, data and other information are not warranted as to
completeness or accuracy and are subject to change without notice.
Any comments or statements made herein do not necessarily reflect
those of JPMorgan Chase & Co., its subsidiaries and affiliates.

This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law. If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED. Although this transmission and any
attachments are believed to be free of any virus or other defect
that might affect any computer system into which it is received and
opened, it is the responsibility of the recipient to ensure that it
is virus free and no responsibility is accepted by JPMorgan Chase &
Co., its subsidiaries and affiliates, as applicable, for any loss
or damage arising in any way from its use. If you received this
transmission in error, please immediately contact the sender and
destroy the material in its entirety, whether in electronic or hard
copy format. Thank you.
Please refer to http://www.jpmorgan.com/pages/disclosures for
disclosures relating to UK legal entities.

Re: AMQP 1.0

Posted by Rafael Schloming <ra...@redhat.com>.
Aidan Skinner wrote:
> On Thu, Mar 19, 2009 at 6:12 PM, Rafael Schloming <ra...@redhat.com> wrote:
> 
>> Robert Godfrey wrote:
> 
>>> That is why I advocate an *interface* rather than casting into
>>> implementation classes.
>> An interface if restricted to only permit features not accessible
>> through vanilla JMS would certainly help, but I still think casting as
>> part of the API unacceptably blurs the boundaries of the API. There is
>> no way to tell what types you're allowed to cast and which interfaces
>> you're allowed to cast it to.
> 
> I've always hated that about Java. I'm pretty firm on the
> bondage-and-discipline side of the strong typing argument though, and
> I realise others mileage may vary.
> 
>> access to the same broker extension. I would probably add an assertion
>> based on the destination, broker vendor/version, etc to verify that the
>> broker and recipient will understand what is being sent.
> 
> I think if we implement non-standard features we should definitely do this.
> 
>>> I understand that you have a pathalogical hatred of casts.  The java
>>> syntax is certainly less than ideal.  However where we are depending
>>> on AMQP specific behaviour it should be called out.
>> It's not casts I dislike. It's casting as part of an API that I dislike
>> since it makes the API unnecessarily blurry. It's also quite trivial to
>> avoid assuming you don't have a pathological hatred of static methods. ;)
> 
> are you talking about something like public static AMQDestination
> toAMQDestination(javax.jms.Destination dest) and that does the cast
> inside AMQDestination?

I was actually thinking about the message case, e.g.:

   AMQMessage m = AMQMessage.fromJMSMessage(...)

or something like that. But you could do something similar with the 
destination. Also, I wasn't necessarily thinking that you would cast 
inside the static method, I think the decorator thing I mentioned 
earlier is worthy of some exploration, but obviously one of the benefits 
of having the method is we can change what it does later.

>>> Hopefully most AMQP/QPID extensions can be isolated in cofiguration
>>> rather than code...
>> I think the destination abstraction is a reasonably useful way to do
>> this for most things. It gives us one mechanism that is mostly used via
>> configuration but can also be used through code as well with
>> createQueue(...) and friends.
> 
> I'm a little confused, are we talking about client config or server config?

I was thinking of client config, specifically what we've traditionally 
referred to as the "binding URL", although I've never actually 
understood why it's a URL, and it really doesn't have all that much to 
do with binding either, particularly in a 1-0 model.

I'm actually just thinking that text based config strings for 
destinations can control a lot of the client behavior we care about, 
e.g. ack policy, sync policy, prefetch, etc, and this has the benefit of 
being usable from both a config file and from code, and it is sort of an 
approved extension point in as much as JMS has them.

--Rafael


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Aidan Skinner <ai...@apache.org>.
On Thu, Mar 19, 2009 at 6:12 PM, Rafael Schloming <ra...@redhat.com> wrote:

> Robert Godfrey wrote:

>> That is why I advocate an *interface* rather than casting into
>> implementation classes.
>
> An interface if restricted to only permit features not accessible
> through vanilla JMS would certainly help, but I still think casting as
> part of the API unacceptably blurs the boundaries of the API. There is
> no way to tell what types you're allowed to cast and which interfaces
> you're allowed to cast it to.

I've always hated that about Java. I'm pretty firm on the
bondage-and-discipline side of the strong typing argument though, and
I realise others mileage may vary.

> access to the same broker extension. I would probably add an assertion
> based on the destination, broker vendor/version, etc to verify that the
> broker and recipient will understand what is being sent.

I think if we implement non-standard features we should definitely do this.

>> I understand that you have a pathalogical hatred of casts.  The java
>> syntax is certainly less than ideal.  However where we are depending
>> on AMQP specific behaviour it should be called out.
>
> It's not casts I dislike. It's casting as part of an API that I dislike
> since it makes the API unnecessarily blurry. It's also quite trivial to
> avoid assuming you don't have a pathological hatred of static methods. ;)

are you talking about something like public static AMQDestination
toAMQDestination(javax.jms.Destination dest) and that does the cast
inside AMQDestination?

>> Hopefully most AMQP/QPID extensions can be isolated in cofiguration
>> rather than code...
>
> I think the destination abstraction is a reasonably useful way to do
> this for most things. It gives us one mechanism that is mostly used via
> configuration but can also be used through code as well with
> createQueue(...) and friends.

I'm a little confused, are we talking about client config or server config?

- Aidan

-- 
Apache Qpid - World Domination through Advanced Message Queueing
http://qpid.apache.org

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Rafael Schloming <ra...@redhat.com>.
Robert Godfrey wrote:
> [.. snip ..]
> 
>> I tend to dislike the casting approach since if you need to make more than
>> one or two calls it becomes quite cumbersome and people then inevitably just
>> declare their variables to be of the non JMS type and then it's unclear
>> which calls are pure JMS and which aren't.
>>
>> I also think it's a bit of a hack to be required to cast as part of an API.
>> It's difficult to tell whether you're casting into an approved part of the
>> API or whether you're casting to some random implementation specific
>> interface that the object just happens to implement.
> 
> That is why I advocate an *interface* rather than casting into
> implementation classes.

An interface if restricted to only permit features not accessible
through vanilla JMS would certainly help, but I still think casting as
part of the API unacceptably blurs the boundaries of the API. There is
no way to tell what types you're allowed to cast and which interfaces
you're allowed to cast it to.

>>> Using custom headers hides dependencies and makes things compile (or
>>> link) even when they should fail.
>> This is only true if you hardcode your header values rather than using some
>> API to set them. Using constants will cause a compile time failure, and
>> using a decorator will cause both compile and link failures.
> 
> It will cause a compile time failure but not a run time failure.  You
> can have the jar in your classpath without it being the JMS client
> that you are actually using.

Yes, I was considering that a feature. It doesn't matter whether you
have an 0-8, 0-9, 0-10, or 1-0 JMS message underneath, you still have
access to the same broker extension. I would probably add an assertion
based on the destination, broker vendor/version, etc to verify that the
broker and recipient will understand what is being sent.

>> I think there are different sorts of AMQP specific behavior that we need to
>> think about here. For example I would make a distinction between AMQP or
>> Qpid specific broker features, and AMQP or Qpid specific client features. I
>> think accessing AMQP or Qpid specific broker features through a well defined
>> set of message headers is probably a reasonable way to go, and there are a
>> variety of ways to set these headers that provide differing levels of
>> compile and/or runtime protection to the application. But really for
>> accessing broker features there is no need to tie anything to the specific
>> JMS implementation in question, e.g.:
>>
>> Message msg = ..;
>> QpidMessage qmsg = new QpidMessage(msg);
>> qmsg.setFoo(); // equivalent to msg.setStringProperty(QpidHeaders.FOO,
>> "bar") which is in turn equivalent to
>> msg.setStringProperty("org.apache.qpid.foo", "bar")
> 
> I think the JMS Properties should be used as intended - that is as a
> way of adding to the end-to-end properties of the message (payload)
> being sent.  If the extension is on the broker, and is triggered by
> such a property then setting the property is the appropriate
> mechanism.  However if the AMQP extension is something that should be
> interpreted by the client then I do not believe that we should be
> using such an ugly hack.

I wasn't suggesting using headers for controlling client local behavior.
I think actually we should take appropriate advantage of the destination
abstraction for that.

> I understand that you have a pathalogical hatred of casts.  The java
> syntax is certainly less than ideal.  However where we are depending
> on AMQP specific behaviour it should be called out.

It's not casts I dislike. It's casting as part of an API that I dislike
since it makes the API unnecessarily blurry. It's also quite trivial to
avoid assuming you don't have a pathological hatred of static methods. ;)

> My feeling is that given where we are taking the 1-0 spec there is
> likely to be *much* less of this required.
> 
> The only examples I can think of off-hand on messages might be audit
> trails or signatures...

Yes, I think most extensions are actually likely to be more Qpid
specific than AMQP specific as well.

>> For AMQP or Qpid specific behavior related to the client implementation,
>> e.g. acking behavior, prefetch behavior, etc, I think this is something of a
>> different story, and I would probably take these features on a case by case
>> basis. I suspect it's probably not an either/or situation and we'll want
>> both configuration for people deploying pre-existing vanilla JMS apps, as
>> well as API for people writing stuff from scratch or "porting" to qpid.
>>
> 
> My view is that you should try to avoid to using *any* AMQP or Qpid
> specific extensions.  Where they are to be relied upon I (as an
> architect or manager of a development team) want those dependencies to
> be called out *very* explicitly.  The use of magic headers etc. is the
> sort of thing that makes porting between message providers *very* hard
> (been there done that).

I wasn't suggesting using magic headers for this sort of thing. I think 
the destination abstraction can be used for most of what we need here.

> Hopefully most AMQP/QPID extensions can be isolated in cofiguration
> rather than code...

I think the destination abstraction is a reasonably useful way to do
this for most things. It gives us one mechanism that is mostly used via
configuration but can also be used through code as well with
createQueue(...) and friends.

--Rafael



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Robert Godfrey <ro...@gmail.com>.
[.. snip ..]

> I tend to dislike the casting approach since if you need to make more than
> one or two calls it becomes quite cumbersome and people then inevitably just
> declare their variables to be of the non JMS type and then it's unclear
> which calls are pure JMS and which aren't.
>
> I also think it's a bit of a hack to be required to cast as part of an API.
> It's difficult to tell whether you're casting into an approved part of the
> API or whether you're casting to some random implementation specific
> interface that the object just happens to implement.

That is why I advocate an *interface* rather than casting into
implementation classes.

>> Using custom headers hides dependencies and makes things compile (or
>> link) even when they should fail.
>
> This is only true if you hardcode your header values rather than using some
> API to set them. Using constants will cause a compile time failure, and
> using a decorator will cause both compile and link failures.

It will cause a compile time failure but not a run time failure.  You
can have the jar in your classpath without it being the JMS client
that you are actually using.

> I think there are different sorts of AMQP specific behavior that we need to
> think about here. For example I would make a distinction between AMQP or
> Qpid specific broker features, and AMQP or Qpid specific client features. I
> think accessing AMQP or Qpid specific broker features through a well defined
> set of message headers is probably a reasonable way to go, and there are a
> variety of ways to set these headers that provide differing levels of
> compile and/or runtime protection to the application. But really for
> accessing broker features there is no need to tie anything to the specific
> JMS implementation in question, e.g.:
>
> Message msg = ..;
> QpidMessage qmsg = new QpidMessage(msg);
> qmsg.setFoo(); // equivalent to msg.setStringProperty(QpidHeaders.FOO,
> "bar") which is in turn equivalent to
> msg.setStringProperty("org.apache.qpid.foo", "bar")

I think the JMS Properties should be used as intended - that is as a
way of adding to the end-to-end properties of the message (payload)
being sent.  If the extension is on the broker, and is triggered by
such a property then setting the property is the appropriate
mechanism.  However if the AMQP extension is something that should be
interpreted by the client then I do not believe that we should be
using such an ugly hack.

I understand that you have a pathalogical hatred of casts.  The java
syntax is certainly less than ideal.  However where we are depending
on AMQP specific behaviour it should be called out.

My feeling is that given where we are taking the 1-0 spec there is
likely to be *much* less of this required.

The only examples I can think of off-hand on messages might be audit
trails or signatures...


> For AMQP or Qpid specific behavior related to the client implementation,
> e.g. acking behavior, prefetch behavior, etc, I think this is something of a
> different story, and I would probably take these features on a case by case
> basis. I suspect it's probably not an either/or situation and we'll want
> both configuration for people deploying pre-existing vanilla JMS apps, as
> well as API for people writing stuff from scratch or "porting" to qpid.
>

My view is that you should try to avoid to using *any* AMQP or Qpid
specific extensions.  Where they are to be relied upon I (as an
architect or manager of a development team) want those dependencies to
be called out *very* explicitly.  The use of magic headers etc. is the
sort of thing that makes porting between message providers *very* hard
(been there done that).

Hopefully most AMQP/QPID extensions can be isolated in cofiguration
rather than code...

--Rob

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Rafael Schloming <ra...@redhat.com>.
Robert Godfrey wrote:
> 2009/3/19 Rajith Attapattu <ra...@gmail.com>:
>> On Thu, Mar 19, 2009 at 9:40 AM, Aidan Skinner <ai...@apache.org> wrote:
>>> On Thu, Mar 19, 2009 at 1:29 PM, Rajith Attapattu <ra...@gmail.com> wrote:
>>>> On Thu, Mar 19, 2009 at 6:36 AM, Aidan Skinner <ai...@apache.org> wrote:
>>>>> On Wed, Mar 18, 2009 at 8:26 PM, Gordon Sim <gs...@redhat.com> wrote:
>>>>> The Java client uses JMS for this to an extent, but we still need a
>>>>> way of exposing AMQP specific things in ways that are as version
>>>>> independent as possible (such as the mandatory flag). I've been
>>>>> kicking around the idea of something like this:
>>>>>
>>>> I am of the opinion that you could get 99% of the AMQP stuff while
>>>> still using pure JMS.
>>>> I have a few ideas around how to do the immediate flag etc while still
>>>> using pure JMS.
>>>> One such idea is to pass in a QPID specific property in the message
>>>> called "AMQP_IMMEDIATE" and the respective sender method can look for
>>>> the presense of this flag and put that in the delivery props. When
>>> See, I'm not sure this is really "pure JMS". It may not use any
>>> non-JMS API, but it does rely on non-JMS semantics.
>>>
>>> I can easily see that this improves portability from a "does my code
>>> compile" PoV. I think it may be quite unhelpful from a "does my code
>>> still work" PoV however. Having non-JMS features available as non-JMS
>>> API at least makes their dependence on this more obvious.
> 
> I completely agree with Aidan's point here.
> 
> Frankly if you are relying on AMQP specific semantics then you should
> make this clear in the code.
> 
> Personally I would think
> 
> if(msg instanceof AMQMessage)
> {
>     ((AMQMessage)msg).setImmediate(true);
> }

I tend to dislike the casting approach since if you need to make more 
than one or two calls it becomes quite cumbersome and people then 
inevitably just declare their variables to be of the non JMS type and 
then it's unclear which calls are pure JMS and which aren't.

I also think it's a bit of a hack to be required to cast as part of an 
API. It's difficult to tell whether you're casting into an approved part 
of the API or whether you're casting to some random implementation 
specific interface that the object just happens to implement.

> Using custom headers hides dependencies and makes things compile (or
> link) even when they should fail.

This is only true if you hardcode your header values rather than using 
some API to set them. Using constants will cause a compile time failure, 
and using a decorator will cause both compile and link failures.

I think there are different sorts of AMQP specific behavior that we need 
to think about here. For example I would make a distinction between AMQP 
or Qpid specific broker features, and AMQP or Qpid specific client 
features. I think accessing AMQP or Qpid specific broker features 
through a well defined set of message headers is probably a reasonable 
way to go, and there are a variety of ways to set these headers that 
provide differing levels of compile and/or runtime protection to the 
application. But really for accessing broker features there is no need 
to tie anything to the specific JMS implementation in question, e.g.:

Message msg = ..;
QpidMessage qmsg = new QpidMessage(msg);
qmsg.setFoo(); // equivalent to msg.setStringProperty(QpidHeaders.FOO, 
"bar") which is in turn equivalent to 
msg.setStringProperty("org.apache.qpid.foo", "bar")

For AMQP or Qpid specific behavior related to the client implementation, 
e.g. acking behavior, prefetch behavior, etc, I think this is something 
of a different story, and I would probably take these features on a case 
by case basis. I suspect it's probably not an either/or situation and 
we'll want both configuration for people deploying pre-existing vanilla 
JMS apps, as well as API for people writing stuff from scratch or 
"porting" to qpid.

--Rafael


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Robert Godfrey <ro...@gmail.com>.
2009/3/19 Rajith Attapattu <ra...@gmail.com>:
> On Thu, Mar 19, 2009 at 9:40 AM, Aidan Skinner <ai...@apache.org> wrote:
>> On Thu, Mar 19, 2009 at 1:29 PM, Rajith Attapattu <ra...@gmail.com> wrote:
>>> On Thu, Mar 19, 2009 at 6:36 AM, Aidan Skinner <ai...@apache.org> wrote:
>>>> On Wed, Mar 18, 2009 at 8:26 PM, Gordon Sim <gs...@redhat.com> wrote:
>>
>>>> The Java client uses JMS for this to an extent, but we still need a
>>>> way of exposing AMQP specific things in ways that are as version
>>>> independent as possible (such as the mandatory flag). I've been
>>>> kicking around the idea of something like this:
>>>>
>>>
>>> I am of the opinion that you could get 99% of the AMQP stuff while
>>> still using pure JMS.
>>> I have a few ideas around how to do the immediate flag etc while still
>>> using pure JMS.
>>> One such idea is to pass in a QPID specific property in the message
>>> called "AMQP_IMMEDIATE" and the respective sender method can look for
>>> the presense of this flag and put that in the delivery props. When
>>
>> See, I'm not sure this is really "pure JMS". It may not use any
>> non-JMS API, but it does rely on non-JMS semantics.
>>
>> I can easily see that this improves portability from a "does my code
>> compile" PoV. I think it may be quite unhelpful from a "does my code
>> still work" PoV however. Having non-JMS features available as non-JMS
>> API at least makes their dependence on this more obvious.

I completely agree with Aidan's point here.

Frankly if you are relying on AMQP specific semantics then you should
make this clear in the code.

Personally I would think

if(msg instanceof AMQMessage)
{
    ((AMQMessage)msg).setImmediate(true);
}

is entirely appropriate.  Best would be if AMQMessage was defined by
the AMQP Working Group and provided in an org.amqp package...

[aside - immediate is a really terrible example here as it is not
something that exists in 1-0].

Using custom headers hides dependencies and makes things compile (or
link) even when they should fail.

Implementation wise the current (0-8/0-9) / 0-10 multiversion stuff is
a bit of / complete nightmare.

I think the 1-0 code should be *much more* separate from the existing code.

On the interfaces side, what I was saying was that AMQMessage need not
extend JMS Message, etc...  Our *implementation* of a Message class
would likely implement both.

My main concern would be if there were any legal implications to
publishing a set of AMQP interfaces that depended on the JMS ones...

-- Rob

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Aidan Skinner <ai...@apache.org>.
On Thu, Mar 19, 2009 at 2:05 PM, Rajith Attapattu <ra...@gmail.com> wrote:

> Based on my experience with end users I found that people are very
> keen on sticking to the JMS API's as much as possible.
> Most of them were moving from an existing JMS provider to Qpid.
> If they have to use anything vendor specific their strong preference
> was to use configuration files, jvm arguments, flags etc...
> Using non JMS API's is something they want to avoid as much as possible.
>
> So from an end users pov, when switching a provider I would like to do
> as less work as possible and having portable code is a big plus point
> IMO.
> Even for an existing Qpid user, when switching from an 0-8/0-9 to 0-10
> to 1.0 this approach IMO provides a more pain free strategy.

I totally understand this desire for portability, and I can see why
users would benefit from sticking to JMS APIs wherever possible. My
point is that writing portable JMS requires not just passing the right
parameters to the right methods, but expecting the correct semantics
from those parameters.

It doesn't help my app's portability if it turns out that I also need
to put a magic string into a properties file for it to work as I
expect. That's something that's likely to be found in QA.

IMO, it's much better for me to have to cast to something that
specifically identifies the depedency and, hopefully, has a comment
about why that's there. That's something that the compiler picks up
when I swap out on JMS provider for another.

- Aidan

-- 
Apache Qpid - World Domination through Advanced Message Queueing
http://qpid.apache.org

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Rajith Attapattu <ra...@gmail.com>.
On Thu, Mar 19, 2009 at 9:40 AM, Aidan Skinner <ai...@apache.org> wrote:
> On Thu, Mar 19, 2009 at 1:29 PM, Rajith Attapattu <ra...@gmail.com> wrote:
>> On Thu, Mar 19, 2009 at 6:36 AM, Aidan Skinner <ai...@apache.org> wrote:
>>> On Wed, Mar 18, 2009 at 8:26 PM, Gordon Sim <gs...@redhat.com> wrote:
>
>>> The Java client uses JMS for this to an extent, but we still need a
>>> way of exposing AMQP specific things in ways that are as version
>>> independent as possible (such as the mandatory flag). I've been
>>> kicking around the idea of something like this:
>>>
>>
>> I am of the opinion that you could get 99% of the AMQP stuff while
>> still using pure JMS.
>> I have a few ideas around how to do the immediate flag etc while still
>> using pure JMS.
>> One such idea is to pass in a QPID specific property in the message
>> called "AMQP_IMMEDIATE" and the respective sender method can look for
>> the presense of this flag and put that in the delivery props. When
>
> See, I'm not sure this is really "pure JMS". It may not use any
> non-JMS API, but it does rely on non-JMS semantics.
>
> I can easily see that this improves portability from a "does my code
> compile" PoV. I think it may be quite unhelpful from a "does my code
> still work" PoV however. Having non-JMS features available as non-JMS
> API at least makes their dependence on this more obvious.

Based on my experience with end users I found that people are very
keen on sticking to the JMS API's as much as possible.
Most of them were moving from an existing JMS provider to Qpid.
If they have to use anything vendor specific their strong preference
was to use configuration files, jvm arguments, flags etc...
Using non JMS API's is something they want to avoid as much as possible.

So from an end users pov, when switching a provider I would like to do
as less work as possible and having portable code is a big plus point
IMO.
Even for an existing Qpid user, when switching from an 0-8/0-9 to 0-10
to 1.0 this approach IMO provides a more pain free strategy.


Regards,

Rajith


> - Aidan
>
> --
> Apache Qpid - World Domination through Advanced Message Queueing
> http://qpid.apache.org
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>
>

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Aidan Skinner <ai...@apache.org>.
On Thu, Mar 19, 2009 at 1:29 PM, Rajith Attapattu <ra...@gmail.com> wrote:
> On Thu, Mar 19, 2009 at 6:36 AM, Aidan Skinner <ai...@apache.org> wrote:
>> On Wed, Mar 18, 2009 at 8:26 PM, Gordon Sim <gs...@redhat.com> wrote:

>> The Java client uses JMS for this to an extent, but we still need a
>> way of exposing AMQP specific things in ways that are as version
>> independent as possible (such as the mandatory flag). I've been
>> kicking around the idea of something like this:
>>
>
> I am of the opinion that you could get 99% of the AMQP stuff while
> still using pure JMS.
> I have a few ideas around how to do the immediate flag etc while still
> using pure JMS.
> One such idea is to pass in a QPID specific property in the message
> called "AMQP_IMMEDIATE" and the respective sender method can look for
> the presense of this flag and put that in the delivery props. When

See, I'm not sure this is really "pure JMS". It may not use any
non-JMS API, but it does rely on non-JMS semantics.

I can easily see that this improves portability from a "does my code
compile" PoV. I think it may be quite unhelpful from a "does my code
still work" PoV however. Having non-JMS features available as non-JMS
API at least makes their dependence on this more obvious.

- Aidan

-- 
Apache Qpid - World Domination through Advanced Message Queueing
http://qpid.apache.org

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Rajith Attapattu <ra...@gmail.com>.
On Thu, Mar 19, 2009 at 6:36 AM, Aidan Skinner <ai...@apache.org> wrote:
> On Wed, Mar 18, 2009 at 8:26 PM, Gordon Sim <gs...@redhat.com> wrote:
>
>> I think, as has been discussed on this list recently, that getting some
>> higher level, protocol-independent APIs for those languages that don't
>> currently have them is a necessary first step and one that will be valuable
>> regardless.
>
> I think this is going to be really helpful for client applications,
> most of which don't really want to be tied to protocol versions.
>
> The Java client uses JMS for this to an extent, but we still need a
> way of exposing AMQP specific things in ways that are as version
> independent as possible (such as the mandatory flag). I've been
> kicking around the idea of something like this:
>

I am of the opinion that you could get 99% of the AMQP stuff while
still using pure JMS.
I have a few ideas around how to do the immediate flag etc while still
using pure JMS.
One such idea is to pass in a QPID specific property in the message
called "AMQP_IMMEDIATE" and the respective sender method can look for
the presense of this flag and put that in the delivery props. When
using properties like this we don't have to worry about a specific
AMQP version, as the respective delegate (ex BasicMessageProducer_0_10
in this instance) will know which flags to look and anything else can
be ignored.

I am currently working on a prototype to see how best we can use queue
declare and binding arguments when defining our destinations, so we
don't have to use anything non JMS.

So I believe a fair bit can be done while still using pure JMS.

> JMSSession -> AMQSession -> AMQ_[ver]_session
>
> With only things that are supported by all version fo AMQP in
> AMQSession. This does lead to a couple of problems though, such as
> features that are in all but one version of spec.
>
> The other option I was considering was something like
>
> JMSSession -> AMQSession -> AMQPre10Session -> AMQ010Session
>
> but I think that may be over engineering for the sake of over engineering.

I think the current way of having a version specific delegate seems to
have worked well.
AMQSession (JMS Session) --> AMQ_version_specific_delegate.

But of course I am always open to better ideas.

Regards,

Rajith

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Aidan Skinner <ai...@apache.org>.
On Wed, Mar 18, 2009 at 8:26 PM, Gordon Sim <gs...@redhat.com> wrote:

> I think, as has been discussed on this list recently, that getting some
> higher level, protocol-independent APIs for those languages that don't
> currently have them is a necessary first step and one that will be valuable
> regardless.

I think this is going to be really helpful for client applications,
most of which don't really want to be tied to protocol versions.

The Java client uses JMS for this to an extent, but we still need a
way of exposing AMQP specific things in ways that are as version
independent as possible (such as the mandatory flag). I've been
kicking around the idea of something like this:

JMSSession -> AMQSession -> AMQ_[ver]_session

With only things that are supported by all version fo AMQP in
AMQSession. This does lead to a couple of problems though, such as
features that are in all but one version of spec.

The other option I was considering was something like

JMSSession -> AMQSession -> AMQPre10Session -> AMQ010Session

but I think that may be over engineering for the sake of over engineering.

> The broker has some limited support for multiple protocols at present, but
> they are really the remnants of upgrading from 0-9 'wip' to one version of
> 0-10 and then onto the final 0-10 without breaking the build and test
> suites. I think some thinking and design around improving that in general
> terms would also be a valuable step forwards.

The java server supports 0-8 and 0-9, but they're really additional
protocol dialects. 0-10 and, in particular, 1-0 have somewhat more
substantial semantic differences. In order to properly support them I
think they key is to have as modular a server as possible.

I've written up some of the improvements to the java server I think
should be made here:
http://qpid.apache.org/java-broker-modularisation.html (that page
needs to be updated a little since some of the works been done in
0.5).

The idea is that the core of the server does the basic work of taking
a message, putting it on disk, putting on a queue, taking it from a
queue and giving it to the client. The details of that, such as how
what message goes on what queue before being delivered to a consumer
and the protocol used to transfer messages, are implemented by 1 or
more plugins which contribute queues, protocol packs, admin wiring
etc.

There are still some significant details to work out, particularly
around administration and translating messages from one protocol
version to another. Clearly nirvana here is for a 0-8 client to be
able to connect, send a message and have it go to 0-9, 0-10 and 1-0
clients and it Just Works. Similarly, persistence plugins shouldn't
have to care about the type of message that they get - they should be
able to persist any of them.

- Aidan
-- 
Apache Qpid - World Domination through Advanced Message Queueing
http://qpid.apache.org

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: AMQP 1.0

Posted by Gordon Sim <gs...@redhat.com>.
James Mansion wrote:
> What's the plan for the 1.0 implementation - is there a design
> document or implementation plan?  Who is doing it?

Based on past experience I think its best to wait until the final spec 
is actually published before getting too concerned about an 
implementation plan.

I think, as has been discussed on this list recently, that getting some 
higher level, protocol-independent APIs for those languages that don't 
currently have them is a necessary first step and one that will be 
valuable regardless.

The broker has some limited support for multiple protocols at present, 
but they are really the remnants of upgrading from 0-9 'wip' to one 
version of 0-10 and then onto the final 0-10 without breaking the build 
and test suites. I think some thinking and design around improving that 
in general terms would also be a valuable step forwards.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org