You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Daniel Cohen-Sason <da...@gmail.com> on 2008/05/14 19:55:01 UTC
SubscriptionManager implemtation for Java Client
Hello.
CPP implementation has an implementation for SubscriptionManager
(qpid\client\SubscriptionManager).
I couldn't find any implementation for Java.
Please advise.
dakash
Re: SubscriptionManager implemtation for Java Client
Posted by Rajith Attapattu <ra...@gmail.com>.
>
> > Is there any document where I can understand the two approaches for QPID
> > Java implmentation (JMS vs. Java)?
>
> Currently there is not, however this questions has come up a couple of
> times so I will write a wiki page about it today. It is something of a
> contentious issue however and there was a long debate about it on the
> mailing list a while ago.
>
> > I really don't know which path to take. where can I have more details
> about
> > it?
>
> What follows is my own opinion, but your questions show that the
> concerns I had were valid.
Rob this actually concerns me to.
We need to create better documentation to clearly direct our user base.
For 95% of the use cases JMS is good enough.
However I still think an AMQP java level API is a useful tool.
In the future the AMQP will be adding security, management etc.
There maybe applications that wants to use these features and an AMQP level
java client maybe needed (maybe not).
IMHO I think it's still a bit early to figure out what is the best way to
support AMQP features that are not exposed via JMS.
This is one reason why I didn't really push any documentation about the low
level AMQP client.
Also I am still not sure how exactly the client should looks like. (Ex very
very close to the protocol or simillar to python/c++)
RabbitMQ has an AMQP java client and I am watching that space to figure out
use cases etc.
When we reach AMQP 1.0 I think there will be less of a debate on whether we
need such a client or not.
So for the time being I am going to observe what is going on lets reevaluate
the situation at that time.
Regards,
Rajith.
Re: SubscriptionManager implemtation for Java Client
Posted by Aidan Skinner <ai...@apache.org>.
On Tue, May 20, 2008 at 4:14 AM, Rajith Attapattu <ra...@gmail.com> wrote:
> Actually the java JMS client on trunk is quite stable and the JMS Client/C++
> broker can give the same (if not better) performance than the M2.1 java
> broker.
The JMS client on trunk is currently quite broken in quite a few ways,
not least regarding protocol negotiation and failover. It needs
fixing, but anybody looking for a stable experience should really be
using our official releases.
- Aidan
--
aim/y!:aidans42 g:aidan.skinner@gmail.com
http://aidan.skinner.me.uk/
"We belong to nobody and nobody belongs to us. We don't even belong to
each other."
Re: SubscriptionManager implemtation for Java Client
Posted by Carl Trieloff <cc...@redhat.com>.
Robert Greig wrote:
> 2008/5/20 Rajith Attapattu <ra...@gmail.com>:
>
>
>> Actually the java JMS client on trunk is quite stable and the JMS Client/C++
>> broker can give the same (if not better) performance than the M2.1 java
>> broker.
>>
>
> Do you have any comparative numbers, e.g. running anything in perftests?
>
> RG
>
Robert,
This is not scientific, but I see Java on one pub/sub 52% slower than
C++ client. I think
we can be closer that to ~ 40% for the 1:1 case given a test where
Arnuad just piped the data
to the socket to measure theoretical max for java.When you start
bringing up more sessions
from a single client, then the difference between the C++ and Java
client seems to spread
even more. From the last data I saw, I think the Java client 0-10 &
0-9/0-8 codepaths are
about equal (within 10% variance) in throughput currently for 1:1 pub/sub
Carl.
Re: SubscriptionManager implemtation for Java Client
Posted by Robert Greig <ro...@gmail.com>.
2008/5/20 Rajith Attapattu <ra...@gmail.com>:
> Actually the java JMS client on trunk is quite stable and the JMS Client/C++
> broker can give the same (if not better) performance than the M2.1 java
> broker.
Do you have any comparative numbers, e.g. running anything in perftests?
RG
Re: SubscriptionManager implemtation for Java Client
Posted by Rajith Attapattu <ra...@gmail.com>.
Daniel,
On Fri, May 16, 2008 at 4:24 AM, Robert Greig <ro...@gmail.com>
wrote:
> 2008/5/15 Daniel Cohen-Sason <da...@gmail.com>:
>
> > Is there any document where I can understand the two approaches for QPID
> > Java implmentation (JMS vs. Java)?
>
> Currently there is not, however this questions has come up a couple of
> times so I will write a wiki page about it today. It is something of a
> contentious issue however and there was a long debate about it on the
> mailing list a while ago.
>
> > I really don't know which path to take. where can I have more details
> about
> > it?
>
> What follows is my own opinion, but your questions show that the
> concerns I had were valid.
>
> > Please correct me if I'm wrong: If I adopt the JMS approach, I'll have
> > richer api and more stable implemtation?
>
> You will certainly get a much more stable implementation - almost
> certainly better performance too. The current M2.x codebase -
> including the JMS client - has had over 18 months of real world
> production usage.
Actually the java JMS client on trunk is quite stable and the JMS Client/C++
broker can give the same (if not better) performance than the M2.1 java
broker.
The catch is that the C++ broker will only work on linux. (Currently there
is an effort in porting it to trunk).
The java broker on the other hand will run on any OS that has a JVM. The
java broker has been in production for a while as well.
Also the trunk is a moving target, and you don't have downloadable
artifacts. So you need to build it from source.
All the bug fixes done for the common code path in M2.1 JMS client is also
in the trunk.
If you have time and resources, please try the trunk JMS client with the C++
broker (trunk) and checkout the performance.
Please let us know your experience with them and your feedback will be very
much appreciated.
Regards,
Rajith
Re: SubscriptionManager implemtation for Java Client
Posted by Daniel Cohen-Sason <da...@gmail.com>.
Rebert.
Thank you so much for the detailed answer!
dakash
On Fri, May 16, 2008 at 11:24 AM, Robert Greig <ro...@gmail.com>
wrote:
> 2008/5/15 Daniel Cohen-Sason <da...@gmail.com>:
>
> > Is there any document where I can understand the two approaches for QPID
> > Java implmentation (JMS vs. Java)?
>
> Currently there is not, however this questions has come up a couple of
> times so I will write a wiki page about it today. It is something of a
> contentious issue however and there was a long debate about it on the
> mailing list a while ago.
>
> > I really don't know which path to take. where can I have more details
> about
> > it?
>
> What follows is my own opinion, but your questions show that the
> concerns I had were valid.
>
> > Please correct me if I'm wrong: If I adopt the JMS approach, I'll have
> > richer api and more stable implemtation?
>
> You will certainly get a much more stable implementation - almost
> certainly better performance too. The current M2.x codebase -
> including the JMS client - has had over 18 months of real world
> production usage. The API itself is widely documented on the web and
> it also should work with third party packages with little effort, e.g.
> Spring or Mule.
>
> The non-JMS Java API is only available on trunk (M3). I *strongly*
> recommend that you do not use trunk unless you really want to be at
> the bleeding edge. If you use the just-released M2.1 version you will
> have the best results. You could take the M2.x branch from svn if you
> want to keep up to date with bug fixes and tweaks, but that codebase
> is stable.
>
> > So what's the point of QPID team to maintain 2 "packages"?
>
> This was exactly the confusion I wanted to avoid. JMS is, whether
> people like it or not, the standard API for messaging for Java
> developers. Some people might not like certain aspects of it but
> basically it is fine for 99% of use cases. There is only so much you
> can do with a messaging API so any other API is not going to be
> radically different anyway.
>
> Some people wanted to offer a "low level" API that exposed the
> underlying AMQP protocol. This was because they wanted to expose
> certain features of the protocol directly (like the ability to wire
> exchanges and queues). However I do not believe you need to create a
> separate API to achieve this, since you can do what every other JMS
> vendor has done and extend JMS with some extra interfaces and methods.
> It may not be the most elegant approach but it does mean that users do
> not have to rewrite their applications to take advantage of one
> feature!
>
> An analogy might help: both SQL Server and Sybase use the Tabular Data
> Stream (TDS) protocol for client/server communication. Neither vendor
> supports application development using an API that exposes TDS
> directly - people use ADO.NET <http://ado.net/> or JDBC or whatever. Some
> people might
> want to work at the TDS level but they are generally tools vendors or
> some other specialised case and neither vendor to my knowledge
> promotes in any way a TDS API.
>
> I do not believe that any API that directly mirrors the protocol is
> useful to end users because it makes life difficult when the protocol
> changes. Anyone, for example, who had written an application against
> an API that mirrored the 0-9 protocol would have to change it just to
> upgrade to 0-10. That is unacceptable for most users - certainly I
> would be irate if I were a user and there was no upgrade path. Using
> JMS or some other higher level API provides the ability to have an
> upgrade path.
>
> So in summary, use the JMS API. I'm sorry this confusion exists; we
> will work to make it clearer. Let me know if any of this is still
> confusing!
>
> RG
>
--
Regards,
Daniel Cohen-Sason
Re: SubscriptionManager implemtation for Java Client
Posted by Robert Greig <ro...@gmail.com>.
2008/5/15 Daniel Cohen-Sason <da...@gmail.com>:
> Is there any document where I can understand the two approaches for QPID
> Java implmentation (JMS vs. Java)?
Currently there is not, however this questions has come up a couple of
times so I will write a wiki page about it today. It is something of a
contentious issue however and there was a long debate about it on the
mailing list a while ago.
> I really don't know which path to take. where can I have more details about
> it?
What follows is my own opinion, but your questions show that the
concerns I had were valid.
> Please correct me if I'm wrong: If I adopt the JMS approach, I'll have
> richer api and more stable implemtation?
You will certainly get a much more stable implementation - almost
certainly better performance too. The current M2.x codebase -
including the JMS client - has had over 18 months of real world
production usage. The API itself is widely documented on the web and
it also should work with third party packages with little effort, e.g.
Spring or Mule.
The non-JMS Java API is only available on trunk (M3). I *strongly*
recommend that you do not use trunk unless you really want to be at
the bleeding edge. If you use the just-released M2.1 version you will
have the best results. You could take the M2.x branch from svn if you
want to keep up to date with bug fixes and tweaks, but that codebase
is stable.
> So what's the point of QPID team to maintain 2 "packages"?
This was exactly the confusion I wanted to avoid. JMS is, whether
people like it or not, the standard API for messaging for Java
developers. Some people might not like certain aspects of it but
basically it is fine for 99% of use cases. There is only so much you
can do with a messaging API so any other API is not going to be
radically different anyway.
Some people wanted to offer a "low level" API that exposed the
underlying AMQP protocol. This was because they wanted to expose
certain features of the protocol directly (like the ability to wire
exchanges and queues). However I do not believe you need to create a
separate API to achieve this, since you can do what every other JMS
vendor has done and extend JMS with some extra interfaces and methods.
It may not be the most elegant approach but it does mean that users do
not have to rewrite their applications to take advantage of one
feature!
An analogy might help: both SQL Server and Sybase use the Tabular Data
Stream (TDS) protocol for client/server communication. Neither vendor
supports application development using an API that exposes TDS
directly - people use ADO.NET or JDBC or whatever. Some people might
want to work at the TDS level but they are generally tools vendors or
some other specialised case and neither vendor to my knowledge
promotes in any way a TDS API.
I do not believe that any API that directly mirrors the protocol is
useful to end users because it makes life difficult when the protocol
changes. Anyone, for example, who had written an application against
an API that mirrored the 0-9 protocol would have to change it just to
upgrade to 0-10. That is unacceptable for most users - certainly I
would be irate if I were a user and there was no upgrade path. Using
JMS or some other higher level API provides the ability to have an
upgrade path.
So in summary, use the JMS API. I'm sorry this confusion exists; we
will work to make it clearer. Let me know if any of this is still
confusing!
RG
Re: SubscriptionManager implemtation for Java Client
Posted by Daniel Cohen-Sason <da...@gmail.com>.
Thanks Robert.
I'll try that.
Is there any document where I can understand the two approaches for QPID
Java implmentation (JMS vs. Java)?
I really don't know which path to take. where can I have more details about
it?
Please correct me if I'm wrong: If I adopt the JMS approach, I'll have
richer api and more stable implemtation?
So what's the point of QPID team to maintain 2 "packages"?
Please advise.
dakash
On Thu, May 15, 2008 at 10:14 AM, Robert Greig <ro...@gmail.com>
wrote:
> 2008/5/15 Daniel Cohen-Sason <da...@gmail.com>:
>
> > In C++, the "SubscriptionManager" allow me to subscribe a listener to
> > several queues -
> >
> > This gives my client the flexibility to dynamically receive messages from
> > several queues ["dynamic" because I can dynamically decide, during the
> > listener generation, to which queues to "listen"]
> >
> > Is there an equivalent mechanism here? [In Java]
> > dakash
>
> Yes, you can do this in Java (i.e. JMS) - but do correct me if I have
> missed something in your requirement.
>
> You can implement the javax.jms.MessageListener and register it with
> however many javax.jms.MessageConsumers you have (you have one
> consumer per destination).
>
> So:
>
> MessageListener myListener = createMessageListener(...);
> session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
> for (Destination d : destinations)
> {
> MesssageConsumer conssumer = session.createConsumer(d);
> consumer.setMessageListener(myListener);
> }
>
> connection.start();
>
> I hope that is what you were looking to do.
>
> RG
>
--
Regards,
Daniel Cohen-Sason
Re: SubscriptionManager implemtation for Java Client
Posted by Robert Greig <ro...@gmail.com>.
2008/5/15 Daniel Cohen-Sason <da...@gmail.com>:
> In C++, the "SubscriptionManager" allow me to subscribe a listener to
> several queues -
>
> This gives my client the flexibility to dynamically receive messages from
> several queues ["dynamic" because I can dynamically decide, during the
> listener generation, to which queues to "listen"]
>
> Is there an equivalent mechanism here? [In Java]
> dakash
Yes, you can do this in Java (i.e. JMS) - but do correct me if I have
missed something in your requirement.
You can implement the javax.jms.MessageListener and register it with
however many javax.jms.MessageConsumers you have (you have one
consumer per destination).
So:
MessageListener myListener = createMessageListener(...);
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
for (Destination d : destinations)
{
MesssageConsumer conssumer = session.createConsumer(d);
consumer.setMessageListener(myListener);
}
connection.start();
I hope that is what you were looking to do.
RG
Re: SubscriptionManager implemtation for Java Client
Posted by Daniel Cohen-Sason <da...@gmail.com>.
Hello Again.
I'll try to explain a little bit more what i'm trying to do .
In C++, the "SubscriptionManager" allow me to subscribe a listener to
several queues -
This gives my client the flexibility to dynamically receive messages from
several queues ["dynamic" because I can dynamically decide, during the
listener generation, to which queues to "listen"]
Is there an equivalent mechanism here? [In Java]
dakash
On Thu, May 15, 2008 at 6:37 AM, Daniel Cohen-Sason <da...@gmail.com>
wrote:
> Hello.
> "the assumption that most users will use the JMS API".
>
> Can you please clarify this? Is there an equivalent class which is
> implemented in JMS?
> Or, should I write my own "SubscriptionManager"?
>
> dakash
>
>
>
> On Thu, May 15, 2008 at 12:58 AM, Alan Conway <ac...@redhat.com> wrote:
>
>> Daniel Cohen-Sason wrote:
>>
>>> Hello.
>>> CPP implementation has an implementation for SubscriptionManager
>>> (qpid\client\SubscriptionManager).
>>>
>>> I couldn't find any implementation for Java.
>>>
>>> Please advise.
>>>
>>> dakash
>>>
>>>
>> AFAIK there isn't one. The C++ API is similar to the python API, both are
>> essentially generated directly from the AMQP specification. However the
>> straight AMQP spec mapping makes subscribing rather tedious and error-prone,
>> the subscription manager is a convenience wrapper to make it easier.
>>
>> I don't think Java has such a wrapper on the assumption that most users
>> will use the JMS API. If we do add it to Java it would be good to keep the
>> APIs at least loosely aligned.
>>
>> Cheers,
>> Alan.
>>
>
>
>
> --
> Regards,
> Daniel Cohen-Sason
--
Regards,
Daniel Cohen-Sason
Re: SubscriptionManager implemtation for Java Client
Posted by Daniel Cohen-Sason <da...@gmail.com>.
Hello.
"the assumption that most users will use the JMS API".
Can you please clarify this? Is there an equivalent class which is
implemented in JMS?
Or, should I write my own "SubscriptionManager"?
dakash
On Thu, May 15, 2008 at 12:58 AM, Alan Conway <ac...@redhat.com> wrote:
> Daniel Cohen-Sason wrote:
>
>> Hello.
>> CPP implementation has an implementation for SubscriptionManager
>> (qpid\client\SubscriptionManager).
>>
>> I couldn't find any implementation for Java.
>>
>> Please advise.
>>
>> dakash
>>
>>
> AFAIK there isn't one. The C++ API is similar to the python API, both are
> essentially generated directly from the AMQP specification. However the
> straight AMQP spec mapping makes subscribing rather tedious and error-prone,
> the subscription manager is a convenience wrapper to make it easier.
>
> I don't think Java has such a wrapper on the assumption that most users
> will use the JMS API. If we do add it to Java it would be good to keep the
> APIs at least loosely aligned.
>
> Cheers,
> Alan.
>
--
Regards,
Daniel Cohen-Sason
Re: SubscriptionManager implemtation for Java Client
Posted by Alan Conway <ac...@redhat.com>.
Daniel Cohen-Sason wrote:
> Hello.
> CPP implementation has an implementation for SubscriptionManager
> (qpid\client\SubscriptionManager).
>
> I couldn't find any implementation for Java.
>
> Please advise.
>
> dakash
>
AFAIK there isn't one. The C++ API is similar to the python API, both are
essentially generated directly from the AMQP specification. However the straight
AMQP spec mapping makes subscribing rather tedious and error-prone, the
subscription manager is a convenience wrapper to make it easier.
I don't think Java has such a wrapper on the assumption that most users will use
the JMS API. If we do add it to Java it would be good to keep the APIs at least
loosely aligned.
Cheers,
Alan.
Re: SubscriptionManager implemtation for Java Client
Posted by Robert Greig <ro...@gmail.com>.
2008/5/14 Daniel Cohen-Sason <da...@gmail.com>:
> CPP implementation has an implementation for SubscriptionManager
> (qpid\client\SubscriptionManager).
>
> I couldn't find any implementation for Java.
What are you trying to do?
Robert