You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Rajith Attapattu <ra...@gmail.com> on 2011/02/04 17:22:44 UTC

[JMS] Creating connections & destinations dynamically

Hi,

Some Qpid users like to create connections and destinations dynamically
instead of using the jndi.properties file.
All though there is a reasonable way of creating Queues and Topics using
session.createQueue and session.createTopic respectively, there is currently
no proper way of creating connections.

Therefore people resort to using AMQConnection class., which is less than
ideal.
Chances are that this class can change, get deprecated in favour of a better
implementation etc.. in a future release.

Perhaps we should provide a stable API for creating connections without
having to use internal implementation specific classes for folks who want to
do it dynamically.
Maybe something along the lines of,

Qpid {

public javax.jms.ConnectionFactory createConnectionFactory(String user,
String password);

public javax.jms.ConnectionFactory createConnectionFactory(String url);

public javax.jms.Connection createConnection(String user, String password);

public javax.jms.Connection createConnection(String url);

public javax.jms.Destination(String addr);

}

That way we can shield a Qpid user from changes in a reasonable way.
However we need to impress upon our users that the preferred way is to use
the JNDI mechanism.
On the other hand users could use the above mechanism to create connections
and destinations and inject them into their preferred JNDI mechanism rather
than using our JNDI implementation.

Thoughts ?

Regards,

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

Re: [JMS] Creating connections & destinations dynamically

Posted by Carl Trieloff <cc...@redhat.com>.

log into your apache account, and svn up the relative w1 dir and then 
they should sync on the hour.

Carl.


On 02/10/2011 09:12 AM, Alan Conway wrote:
> I just checked the web site and the C++ API docs are the qpid 
> developer version showing broker internals, not the user version. I 
> verified that "make html" in docs/api does generate the correct user 
> version. How do we update the web site?
>
> ---------------------------------------------------------------------
> 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: [JMS] Creating connections & destinations dynamically

Posted by Robbie Gemmell <ro...@gmail.com>.
The build was broken when I generated the documentation whilst doing
the 0.8 release, that is what it generated at the time. Apparently its
only the fornt page thats wrong though, Jonathan updated it since then
to generate the correct thing...although I had forgotten about
updating the 0;8 copy since then (need to patch the source and
regenerate it), but anyone whos checked in changes to the trunk
documentation since then should have regenerated it and obviously
hasnt....

The site is in svn, at /site as opposed to under /trunk, youll need to
check it out and update the relevant files with the fresh build, and
then once you check them in the change is picked up and deployed to
the webserver

Robbie.

On 10 February 2011 14:12, Alan Conway <ac...@redhat.com> wrote:
> I just checked the web site and the C++ API docs are the qpid developer
> version showing broker internals, not the user version. I verified that
> "make html" in docs/api does generate the correct user version. How do we
> update the web site?
>
> ---------------------------------------------------------------------
> 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: [JMS] Creating connections & destinations dynamically

Posted by Jonathan Robie <jo...@redhat.com>.
On 02/10/2011 09:12 AM, Alan Conway wrote:
> I just checked the web site and the C++ API docs are the qpid developer
> version showing broker internals, not the user version. I verified that
> "make html" in docs/api does generate the correct user version. How do
> we update the web site?

I've updated it now.

To update it, you check it in to this repo:

https://svn.apache.org/repos/asf/qpid/site

Jonathan

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


Re: [JMS] Creating connections & destinations dynamically

Posted by Alan Conway <ac...@redhat.com>.
I just checked the web site and the C++ API docs are the qpid developer version 
showing broker internals, not the user version. I verified that "make html" in 
docs/api does generate the correct user version. How do we update the web site?

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


Re: [JMS] Creating connections & destinations dynamically

Posted by Jonathan Robie <jo...@redhat.com>.
Where the Python and C++ APIs disagree, which one represents the Common API?

Jonathan

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


Re: [JMS] Creating connections & destinations dynamically

Posted by Rajith Attapattu <ra...@gmail.com>.
I think we ran a bit off topic here - mainly due to my fault.
Can we focus again on the specific JMS issue.

Andrew do you have concerns/comments based on my last reply to the questions
raised by you?

In summary what I mentioned was,

* That I agree that we need some sort of refactoring along the lines you
proposed regardless of what I am proposing. But I doubt that alone will help
in what I am trying to achieve.

* I agree that we need to keep in mind that this mechanism should cater to a
variety of situations like integration/embedding in containers like
spring,app servers, third party apps, external JNDI mechanisms etc..

* That I am not so keen to promote what we have now (Ex.
AMQConnectionFactory) as the public API for a variety of reasons outlined in
my response to yours.

* That we need to have some sort of "Simple" and "Stable" API for this,
especially knowing that our client will be undergoing a lot of changes in
the near future, especially with work related to AMQP 1.0 etc.

Regards,

Rajith

On Fri, Feb 11, 2011 at 2:09 PM, Andrew Kennedy <
andrewinternational@gmail.com> wrote:

> On 11 Feb 2011, at 15:24, Rajith Attapattu wrote:
>
>> On Thu, Feb 10, 2011 at 2:11 PM, Gordon Sim <gs...@redhat.com> wrote:
>>
>>> On 02/10/2011 02:54 PM, Rajith Attapattu wrote:
>>>
>>>> The above is not a formal authoritative document that describes what our
>>>> Common API is.
>>>>
>>>>  If by authoritative you mean '100% accurate and complete' then I accept
>>> it
>>> is not there yet.
>>>
>>>
>> Actually by authoritative I didn't really mean accuracy and completeness,
>> rather I was expecting a document in a different form.
>> Perhaps something similar to the JMS spec. I believe you and I have a
>> different vision about how this document should look like.
>> Perhaps that is where the disconnect is. As time permits I will try to
>> work
>> out a document and post it to provide a more complete picture of what I
>> was
>> envisaging.
>>
>
> *Please* don't repeat the mistakes the JMS specification made! I really
> feel it's too vague and wooly for a formal specification, whereas it ought
> to be precise and informative. There are too many situations where I have
> checked the JMS specification, only to find it describes behaviour that
> could be interpreted in several different ways, or worse is simply undefined
> or up to the provider. This style is more suitable for a programmer's guide
> describing the common API, covering the technical terms of reference, design
> philosophy, illustrating common use cases and giving concrete examples of
> code. This type of document was (the first) 2. on your list and 4. on mine,
> assuming your list to be describing six different types of document.
>
> I still think UML is a concise and reasonable way to model the AMQP common
> API in a language agnostic fashion. This is document 1. in both our lists,
> and it MUST have a well-defined correlation with the official AMQP
> specification(s).
>
> Take a look at Enterprise Architect (very good, I used it a lot at Yell for
> data modelling) or the Eclipse modelling tools (never used in anger) for UML
> design tools. To be hones, I think UML is probably too powerful when it
> comes to describing AMQPs data structures and commands, but that should make
> the task easier. It has the benefit that any competent programmer can
> mentally translate between UML and $FAVOURITE_LANGUAGE, and there are tools
> to automatically create HTML documentation or Java, C++ or whatever code
> templates.
>
>
> Andrew.
> --
> -- andrew d kennedy ? do not fold, bend, spindle, or mutilate ;
> -- http://grkvlt.blogspot.com/ ? edinburgh : +44 7582 293 255 ;
>
> ---------------------------------------------------------------------
> 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/

Re: [JMS] Creating connections & destinations dynamically

Posted by Andrew Kennedy <an...@gmail.com>.
On 11 Feb 2011, at 15:24, Rajith Attapattu wrote:
> On Thu, Feb 10, 2011 at 2:11 PM, Gordon Sim <gs...@redhat.com> wrote:
>> On 02/10/2011 02:54 PM, Rajith Attapattu wrote:
>>> The above is not a formal authoritative document that describes  
>>> what our
>>> Common API is.
>>>
>> If by authoritative you mean '100% accurate and complete' then I  
>> accept it
>> is not there yet.
>>
>
> Actually by authoritative I didn't really mean accuracy and  
> completeness,
> rather I was expecting a document in a different form.
> Perhaps something similar to the JMS spec. I believe you and I have a
> different vision about how this document should look like.
> Perhaps that is where the disconnect is. As time permits I will try  
> to work
> out a document and post it to provide a more complete picture of  
> what I was
> envisaging.

*Please* don't repeat the mistakes the JMS specification made! I  
really feel it's too vague and wooly for a formal specification,  
whereas it ought to be precise and informative. There are too many  
situations where I have checked the JMS specification, only to find  
it describes behaviour that could be interpreted in several different  
ways, or worse is simply undefined or up to the provider. This style  
is more suitable for a programmer's guide describing the common API,  
covering the technical terms of reference, design philosophy,  
illustrating common use cases and giving concrete examples of code.  
This type of document was (the first) 2. on your list and 4. on mine,  
assuming your list to be describing six different types of document.

I still think UML is a concise and reasonable way to model the AMQP  
common API in a language agnostic fashion. This is document 1. in  
both our lists, and it MUST have a well-defined correlation with the  
official AMQP specification(s).

Take a look at Enterprise Architect (very good, I used it a lot at  
Yell for data modelling) or the Eclipse modelling tools (never used  
in anger) for UML design tools. To be hones, I think UML is probably  
too powerful when it comes to describing AMQPs data structures and  
commands, but that should make the task easier. It has the benefit  
that any competent programmer can mentally translate between UML and  
$FAVOURITE_LANGUAGE, and there are tools to automatically create HTML  
documentation or Java, C++ or whatever code templates.

Andrew.
-- 
-- andrew d kennedy ? do not fold, bend, spindle, or mutilate ;
-- http://grkvlt.blogspot.com/ ? edinburgh : +44 7582 293 255 ;

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


Re: [JMS] Creating connections & destinations dynamically

Posted by Rajith Attapattu <ra...@gmail.com>.
On Thu, Feb 10, 2011 at 2:11 PM, Gordon Sim <gs...@redhat.com> wrote:

> On 02/10/2011 02:54 PM, Rajith Attapattu wrote:
>
>> The above is not a formal authoritative document that describes what our
>> Common API is.
>>
>
> If by authoritative you mean '100% accurate and complete' then I accept it
> is not there yet.
>

Actually by authoritative I didn't really mean accuracy and completeness,
rather I was expecting a document in a different form.
Perhaps something similar to the JMS spec. I believe you and I have a
different vision about how this document should look like.
Perhaps that is where the disconnect is. As time permits I will try to work
out a document and post it to provide a more complete picture of what I was
envisaging.


>  The one I am looking for should describe,
>> - The interfaces and their respective methods.
>> - The intended behaviour of these methods.
>>
>
> We do describe the key methods and aspects of their behaviour. I agree a
> more complete listing of methods and their function would be a useful
> addition.


No disagreements there. I am the first to acknowledge that the current docs
are a massive improvement over what we had.
I am also a little unsure if the programming guide is the best place to add
a complete listing of methods and their functions.



>
>
>  - The common message formats we support and how they behave.
>>
>
> We describe map messages in section 2.11. We should add list messages in
> as well.
>
> In addition to these points we have quite a bit on addressing (which forms
> a central part of the API) and its mapping to AMQP 0-10 (though that needs
> to be spelled out in even more detail). We are still missing information on
> exceptions and error conditions.
>
> Yes the addressing has substantial information, and perhaps a tad more than
necessary in certain instances.
I believe the current programming guide has quite a bit of information, but
IMO not necessarily in the best format.
Also I believe some sections have more info than needed and that confuses
the users.

I think it's a matter of presenting what we've got in a more suitable way.
I need to think about this a bit more and will at some point try to provide
an alternative approach to get some feedback.


>  I am looking for a document that describes our
>> Common API in a single document and it is not there.
>>
>
> I believe it is there, but it is incomplete.



>
>
> ---------------------------------------------------------------------
> 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/

Re: [JMS] Creating connections & destinations dynamically

Posted by Gordon Sim <gs...@redhat.com>.
On 02/10/2011 02:54 PM, Rajith Attapattu wrote:
> The above is not a formal authoritative document that describes what our
> Common API is.

If by authoritative you mean '100% accurate and complete' then I accept 
it is not there yet.

> The one I am looking for should describe,
> - The interfaces and their respective methods.
> - The intended behaviour of these methods.

We do describe the key methods and aspects of their behaviour. I agree a 
more complete listing of methods and their function would be a useful 
addition.

> - The common message formats we support and how they behave.

We describe map messages in section 2.11. We should add list messages in
as well.

In addition to these points we have quite a bit on addressing (which 
forms a central part of the API) and its mapping to AMQP 0-10 (though 
that needs to be spelled out in even more detail). We are still missing 
information on exceptions and error conditions.

> I am looking for a document that describes our
> Common API in a single document and it is not there.

I believe it is there, but it is incomplete.

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


Re: [JMS] Creating connections & destinations dynamically

Posted by Rajith Attapattu <ra...@gmail.com>.
On Thu, Feb 10, 2011 at 7:16 PM, Andrew Kennedy <
andrewinternational@gmail.com> wrote:

> On 10 February 2011 14:54, Rajith Attapattu <ra...@gmail.com> wrote:
>
>> On Thu, Feb 10, 2011 at 8:41 AM, Gordon Sim <gs...@redhat.com> wrote:
>>
>>> On 02/10/2011 12:56 PM, Rajith Attapattu wrote:
>>>
>>>> What I was specifically looking for is what exactly do we advertise as
>>>> the "Common API" - what exactly does it look like ?
>>>>
>>>
>
>>> http://qpid.apache.org/books/0.8/Programming-In-Apache-Qpid/html/ch02.html
>>> gives an overview. There is more detail in following sections and in the
>>> respective language references.
>>>
>>
>  However IMO that document has a different purpose than what I am referring
>> to.
>>
>
>  The above is not a formal authoritative document that describes what our
>> Common API is.
>> The one I am looking for should describe,
>> - The interfaces and their respective methods.
>> - The intended behaviour of these methods.
>> - The common message formats we support and how they behave.
>>
>
>
> There is not always a correlation between the formality of a specification
> and its usefulness, particularly when trying to be language agnostic ;)
>
> Perhaps we could try creating a UML mapping of the AMQP specification, and
> describing that? There are other formal specification languages, but UML is
> well known and understood, and AMQP is fairly simple to describe with no
> unusual abstractions. Also, many modelling tools allow generation of
> interfaces for different languages and documentation direct from a UML
> document, which may be useful. I don't have a lot of experience here though,
> so any other suggestions would be good?
>
> Standardised representations of APIs created by, e.g. perl or Java are more
> relevant for general use, c.f. the existing user documents. Simply having
> these native APIs available *and* annotated with references to the AMQP
> specification (which specification/version?) would be a good first step, as
> that can easily illustrate commonalities and inconsistencies. These would be
> where, say, functional languages would start to have very different patterns
> from OOP style languages, and things like the platform threading and
> concurrency model would become significant.
>
>
>  If we have such a document, then that serves as a,
>> 1. A language independent reference for our users and guarantee about
>> stability.
>> 2. A Reference guide for prospective client developers.
>> 2. A guideline for QA folks to figure out what to test and what to expect
>> in terms of behaviour.
>> 3. A basis for interoperability testing between clients.
>> 4. A basis to figure out and document the extras and workarounds added for
>> each language client.
>>
>
>
> Good things to have, obviously.
>
> But I would think this is also a matter for, e.g. the AMQP-WG or
> AMQP-API-SIG (does such a thing exist?) or similar organisation, and would
> be, probably, an incredibly formal specification document that will not be
> of a great amount of use to developers who just want a client API definition
> for $FAVOURITE_LANGUAGE. What developers actually need is references written
> in the idiom of the language or platform they are developing for, and
> although those exist for C++ and Python, as you say, we need to make an
> effort to show how they are related, similarly with the JMS API, although in
> that case we defer to the J2EE javadoc, and I'm not sure it wouldn't end up
> being confusing if we were to deviate from this. I think Java is the problem
> (at leat, odd-one-out) here, as all the swig generated APIs will, of
> necessity, show large similarities. There is of course, the question of AMQP
> 1.0 support, too.
>
>
>  I don't doubt for a minute that we can improve that documentation There
>>> are certainly also some unintentional inconsistencies between languages.
>>>
>>
>
> And, indeed, *intentional* inconsistencies, due to varying client models,
> such as JMS, WCF et al.
>
> The differences I am alluding to are between the Python, C++ and soon to be
Perl and PHP clients.
They all have a high level API (protocol agnostic) which looks very similar,
which IMO is huge win.
However there exists some very minor inconsistencies.
I was hoping a more formal document that describes this high level API will
contribute a lot towards improving on those inconsistencies.

The JMS and WCF will be different and is expected.


>
>  I think the inconsistencies are a result of not having a formal
>> authoritative document. As our client portfolio grows so will these
>> inconsistencies bcos we don't have a proper reference guide. And people tend
>> to interpret certain areas differently which results in these subtle
>> differences.
>>
>
>
> As long as we are positioning the C++ and Java brokers as parts of the same
> product, there needs to be an explanation of the JMS-AMQP mapping, and I
> suppose that also means there should be a Java version of a direct AMQP API
> exposed publicly.
>
> In summary, we need the following items, with 1. being possibly the
> responsibility of the AMQP working group:
>
> 1. Language agnostic description (using UML or some other formal modelling
> language) of a common API based on some AMQP official specification.
> 2. For each client language or platform using AMQP directly, an API
> document in its native, idiomatic form, with annotations referencing the
> official AMQP specification(s).
> 3. For other clients, such as JMS and WCF, a similar API document, with
> annotations linking concepts to their semantic equivalent in the common AMQP
> API  as well as referencing the AMQP specification.
> 4. An informal document describing the common API with links to language or
> platform specific idiosyncrasies.
> 5. An informal programming guide for each type of client, describing
> language/platform specific idiom and idiosyncrasies, with code samples.
> There may be multiple guides for some platforms.
>
> We kind of have 4. and 5. already, and (rudimentary) versions of 2. for
> some clients, as Gordon pointed out. Each of these will probably need to be
> produced separately for each supported AMQP version, with at least 0-9-1,
> 0-10 and 1-0.
>
> As for the rest, I think vmware/rabbitmq do this very nicely, and are
> probably worth emulating. See these pages:
>
> * http://www.rabbitmq.com/specification.html
> * http://www.rabbitmq.com/api-guide.html
> * http://www.rabbitmq.com/amqp-0-9-1-quickref.html
> * http://www.rabbitmq.com/amqp-0-9-1-reference.html
>
> I particularly like their quick reference document. Look at "channel close"
> - it has the method signature, with each parameter linked to the relevant
> part of the AMQP specification, an indication of the support level in their
> client, the method description and documentation, and then links to the
> actual native Java and .NET documentation, and the AMQP specification for
> the command itself:
>
>> channel.close(reply-code reply-code, reply-text reply-text, class-id
>> class-id, method-id method-id) ➔ close-ok
>>
>> Support: full
>> Request a channel close.
>>
>> This method indicates that the sender wants to close the channel. This may
>> be due to internal conditions (e.g. a forced shut-down) or due to an error
>> handling a specific method, i.e. an exception. When a close is due to an
>> exception, the sender provides the class and method id of the method which
>> caused the exception.
>>
>> [javadoc] [dotnetdoc] [amqpdoc]
>>
>>
> Is this what you were thinking of, Rajith?
>
>
Andrew the API I am referring to here is the new Qpid initiative to define a
high level protocol agnostic API.
This API is a generic "messaging" API that can abstract not only multiple
versions of the AMQP protocol, but even a different protocol like Stomp.
This API will provide the same benefits of the JMS API in terms of stability
and not having to worry about the underlying protocol semantics and
behaviour.
The API that is in place for C++ and Python will provide seamless migration
to AMQP 1.0 if and when Qpid implements that.
That to me is a huge win and Kudos to Rafi and Gordon for pioneering this.

Anyways sorry for leading everybody down a rat hole here. Perhaps we should
start a new thread on this and focus on the JMS issue here :)

Rajith



> Cheers,
> Andrew.
> --
> -- andrew d kennedy ? apache qpid project : 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/

Re: [JMS] Creating connections & destinations dynamically

Posted by Andrew Kennedy <an...@gmail.com>.
On 10 February 2011 14:54, Rajith Attapattu <ra...@gmail.com> wrote:
> On Thu, Feb 10, 2011 at 8:41 AM, Gordon Sim <gs...@redhat.com> wrote:
>> On 02/10/2011 12:56 PM, Rajith Attapattu wrote:
>>> What I was specifically looking for is what exactly do we  
>>> advertise as the "Common API" - what exactly does it look like ?

>> http://qpid.apache.org/books/0.8/Programming-In-Apache-Qpid/html/ 
>> ch02.html
>> gives an overview. There is more detail in following sections and  
>> in the
>> respective language references.

> However IMO that document has a different purpose than what I am  
> referring to.

> The above is not a formal authoritative document that describes  
> what our Common API is.
> The one I am looking for should describe,
> - The interfaces and their respective methods.
> - The intended behaviour of these methods.
> - The common message formats we support and how they behave.


There is not always a correlation between the formality of a  
specification and its usefulness, particularly when trying to be  
language agnostic ;)

Perhaps we could try creating a UML mapping of the AMQP  
specification, and describing that? There are other formal  
specification languages, but UML is well known and understood, and  
AMQP is fairly simple to describe with no unusual abstractions. Also,  
many modelling tools allow generation of interfaces for different  
languages and documentation direct from a UML document, which may be  
useful. I don't have a lot of experience here though, so any other  
suggestions would be good?

Standardised representations of APIs created by, e.g. perl or Java  
are more relevant for general use, c.f. the existing user documents.  
Simply having these native APIs available *and* annotated with  
references to the AMQP specification (which specification/version?)  
would be a good first step, as that can easily illustrate  
commonalities and inconsistencies. These would be where, say,  
functional languages would start to have very different patterns from  
OOP style languages, and things like the platform threading and  
concurrency model would become significant.

> If we have such a document, then that serves as a,
> 1. A language independent reference for our users and guarantee  
> about stability.
> 2. A Reference guide for prospective client developers.
> 2. A guideline for QA folks to figure out what to test and what to  
> expect in terms of behaviour.
> 3. A basis for interoperability testing between clients.
> 4. A basis to figure out and document the extras and workarounds  
> added for each language client.


Good things to have, obviously.

But I would think this is also a matter for, e.g. the AMQP-WG or AMQP- 
API-SIG (does such a thing exist?) or similar organisation, and would  
be, probably, an incredibly formal specification document that will  
not be of a great amount of use to developers who just want a client  
API definition for $FAVOURITE_LANGUAGE. What developers actually need  
is references written in the idiom of the language or platform they  
are developing for, and although those exist for C++ and Python, as  
you say, we need to make an effort to show how they are related,  
similarly with the JMS API, although in that case we defer to the  
J2EE javadoc, and I'm not sure it wouldn't end up being confusing if  
we were to deviate from this. I think Java is the problem (at leat,  
odd-one-out) here, as all the swig generated APIs will, of necessity,  
show large similarities. There is of course, the question of AMQP 1.0  
support, too.

>> I don't doubt for a minute that we can improve that documentation  
>> There are certainly also some unintentional inconsistencies  
>> between languages.


And, indeed, *intentional* inconsistencies, due to varying client  
models, such as JMS, WCF et al.

> I think the inconsistencies are a result of not having a formal  
> authoritative document. As our client portfolio grows so will these  
> inconsistencies bcos we don't have a proper reference guide. And  
> people tend to interpret certain areas differently which results in  
> these subtle differences.


As long as we are positioning the C++ and Java brokers as parts of  
the same product, there needs to be an explanation of the JMS-AMQP  
mapping, and I suppose that also means there should be a Java version  
of a direct AMQP API exposed publicly.

In summary, we need the following items, with 1. being possibly the  
responsibility of the AMQP working group:

1. Language agnostic description (using UML or some other formal  
modelling language) of a common API based on some AMQP official  
specification.
2. For each client language or platform using AMQP directly, an API  
document in its native, idiomatic form, with annotations referencing  
the official AMQP specification(s).
3. For other clients, such as JMS and WCF, a similar API document,  
with annotations linking concepts to their semantic equivalent in the  
common AMQP API  as well as referencing the AMQP specification.
4. An informal document describing the common API with links to  
language or platform specific idiosyncrasies.
5. An informal programming guide for each type of client, describing  
language/platform specific idiom and idiosyncrasies, with code  
samples. There may be multiple guides for some platforms.

We kind of have 4. and 5. already, and (rudimentary) versions of 2.  
for some clients, as Gordon pointed out. Each of these will probably  
need to be produced separately for each supported AMQP version, with  
at least 0-9-1, 0-10 and 1-0.

As for the rest, I think vmware/rabbitmq do this very nicely, and are  
probably worth emulating. See these pages:

* http://www.rabbitmq.com/specification.html
* http://www.rabbitmq.com/api-guide.html
* http://www.rabbitmq.com/amqp-0-9-1-quickref.html
* http://www.rabbitmq.com/amqp-0-9-1-reference.html

I particularly like their quick reference document. Look at "channel  
close" - it has the method signature, with each parameter linked to  
the relevant part of the AMQP specification, an indication of the  
support level in their client, the method description and  
documentation, and then links to the actual native Java and .NET  
documentation, and the AMQP specification for the command itself:
> channel.close(reply-code reply-code, reply-text reply-text, class- 
> id class-id, method-id method-id) ➔ close-ok
>
> Support: full
> Request a channel close.
>
> This method indicates that the sender wants to close the channel.  
> This may be due to internal conditions (e.g. a forced shut-down) or  
> due to an error handling a specific method, i.e. an exception. When  
> a close is due to an exception, the sender provides the class and  
> method id of the method which caused the exception.
>
> [javadoc] [dotnetdoc] [amqpdoc]
>

Is this what you were thinking of, Rajith?

Cheers,
Andrew.
-- 
-- andrew d kennedy ? apache qpid project : http://qpid.apache.org/ ;
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: [JMS] Creating connections & destinations dynamically

Posted by Rajith Attapattu <ra...@gmail.com>.
On Thu, Feb 10, 2011 at 8:41 AM, Gordon Sim <gs...@redhat.com> wrote:

> On 02/10/2011 12:56 PM, Rajith Attapattu wrote:
>
>> What I was specifically looking for is what exactly do we advertise as the
>> "Common API" - what exactly does it look like ?
>>
>
> http://qpid.apache.org/books/0.8/Programming-In-Apache-Qpid/html/ch02.htmlgives an overview. There is more detail in following sections and in the
> respective language references.
>

Sir, that is a user guide that does a reasonably good job at explaining how
to use the API. At the beginning of chapter 2 it does provide a high level
view of what the API is.
I also agree that there is useful information in the sections that follow.
However IMO that document has a different purpose than what I am referring
to.

The above is not a formal authoritative document that describes what our
Common API is.
The one I am looking for should describe,
- The interfaces and their respective methods.
- The intended behaviour of these methods.
- The common message formats we support and how they behave.

If we have such a document, then that serves as a,
1. A language independent reference for our users and guarantee about
stability.
2. A Reference guide for prospective client developers.
2. A guideline for QA folks to figure out what to test and what to expect in
terms of behaviour.
3. A basis for interoperability testing between clients.
4. A basis to figure out and document the extras and workarounds added for
each language client.


> I don't doubt for a minute that we can improve that documentation There are
> certainly also some unintentional inconsistencies between languages.


I think the inconsistencies are a result of not having a formal
authoritative document.
As our client portfolio grows so will these inconsistencies bcos we don't
have a proper reference guide.
And people tend to interpret certain areas differently which results in
these subtle differences.


> However I don't think it is accurate or helpful to start by stating that
> the information is not there at all.
>

I just simply stated that I am looking for a document that describes our
Common API in a single document and it is not there.
I didn't criticize any person or any document we already have for not having
enough information.

I certainly didn't imply that the user guide does not have any information
nor do I believe the user guide is the right place for adding the document I
described above either.
The user guide could definitely have a reference to it.
But IMO we certainly don't have the document I described above, and I don't
think it's inaccurate or unhelpful to state such a thing.



>
>
---------------------------------------------------------------------
> 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/

Re: [JMS] Creating connections & destinations dynamically

Posted by Gordon Sim <gs...@redhat.com>.
On 02/10/2011 12:56 PM, Rajith Attapattu wrote:
> What I was specifically looking for is what exactly do we advertise as the
> "Common API" - what exactly does it look like ?

http://qpid.apache.org/books/0.8/Programming-In-Apache-Qpid/html/ch02.html 
gives an overview. There is more detail in following sections and in the 
respective language references.

I don't doubt for a minute that we can improve that documentation There 
are certainly also some unintentional inconsistencies between languages. 
However I don't think it is accurate or helpful to start by stating that 
the information is not there at all.

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


Re: [JMS] Creating connections & destinations dynamically

Posted by Rajith Attapattu <ra...@gmail.com>.
On Thu, Feb 10, 2011 at 4:52 AM, Gordon Sim <gs...@redhat.com> wrote:

> On 02/10/2011 03:26 AM, Rajith Attapattu wrote:
>
>> We do proclaim that we have a common Messaging API for all our non JMS
>> clients (Ex. Python, C++, Perl ..etc)
>> But no where in our website (or for that matter in our documentation) we
>> specify what this common API is.
>>
>
> c++: http://qpid.apache.org/apis/0.8/cpp/html/modules.html
> python: http://qpid.apache.org/apis/0.8/python/html/index.html
>
> Both linked from the main documentation page under the section on 'API
> Reference Documentation'.
>
>
Gordon, I was aware of the individual API docs for both python and C++, but
thats not what I was referring to.
One should not have to read all the individual API docs in order to figure
out what is common and what is not !
As it is there are subtle variations between these API's in terms of methods
as well as behaviour.
Majority doesn't seems to know which one is the intended one which one is
not.

What I was specifically looking for is what exactly do we advertise as the
"Common API" - what exactly does it look like ?
What are the common Interfaces one can expect to see in all the language
clients
What is the behaviour one can expect to see in each of those methods

We need to provide that information to our users along with a guarantee that
the said interfaces are going to be stable going forward.

I do understand that in addition to the common API methods, each language
implementation may have language specific idioms.
Also some of the common methods may need to be tweaked in order to
workaround certain issues and or to overcome the impedance mismatch btw the
said language and the base client.
Ex. The PHP client issues described by Paul Colby.

If we want to document those things, we need to first have a document that
describes the "Common API".
Then we can explain the language specific additions and workarounds which
will give a user a better understanding of the client they are using.

Regards,

Rajith.


> ---------------------------------------------------------------------
> 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/

Re: [JMS] Creating connections & destinations dynamically

Posted by Gordon Sim <gs...@redhat.com>.
On 02/10/2011 03:26 AM, Rajith Attapattu wrote:
> We do proclaim that we have a common Messaging API for all our non JMS
> clients (Ex. Python, C++, Perl ..etc)
> But no where in our website (or for that matter in our documentation) we
> specify what this common API is.

c++: http://qpid.apache.org/apis/0.8/cpp/html/modules.html
python: http://qpid.apache.org/apis/0.8/python/html/index.html

Both linked from the main documentation page under the section on 'API 
Reference Documentation'.

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


Re: [JMS] Creating connections & destinations dynamically

Posted by Rajith Attapattu <ra...@gmail.com>.
On Mon, Feb 7, 2011 at 6:55 PM, Andrew Kennedy <
andrewinternational@gmail.com> wrote:

> On 7 Feb 2011, at 17:00, Rajith Attapattu wrote:
>
>> So far I have only heard positive comments about this approach.
>> Does anybody have any concerns about the approach in general or any
>> comments
>> about how it should be done if it's needed ?
>>
>
> Well, not negative, but I *do* have some questions, which are possibly just
> due to my lack of knowledge of existing documentation and processes.
>
> Basically, how are we going to ensure that this new API never gets
> deprecated? Where do we state/promise these things? There isn't a page of
> Javadoc on the Qpid site showing our fixed, stable, public API sets. I'm
> aware of the docbook/PDF documentation and Java programming guides, but I
> was thinking of something more formal. Anyway, if we can make such a
> statement about your proposed API,


Very good question. I have the same concern as yours for all our public APIs
not just the java client.
We do proclaim that we have a common Messaging API for all our non JMS
clients (Ex. Python, C++, Perl ..etc)
But no where in our website (or for that matter in our documentation) we
specify what this common API is.

I think we need to specify this prominently somewhere in our documentation.
We could list our Java client extensions in the same location.



> why can't we just make that same statement about AMQConnectionFactory, and
> add some extra helper methods to it, as needed, documenting and publishing
> as we go? I believe the effect would be identical...
>

To begin with I don't think the AMQConnectionFactory is a good candidate to
expose as a public interface as it is.
There are many public methods in it that are unnecessary for our purpose and
will only confuse users.
There are also several helper methods that we may need to add like
createDestination which will only make the ConnectionFactory implementation
bloated.

Also there can be more than one ConnectionFactory implementation in the code
base.
There has been some interest in one which can do connection pooling.

We need to find a way to hide all these complexities behind a simple stable
interface that can be easily maintained.
Exposing the AMQConnectionFactory as it is will not cut it.


> In principle, I agree we need to set up some stable APIs but, why not start
> off by documenting and improving the existing ones first, and then add your
> proposed code in there?
>

I am not against this at all. But I am not sure which of the existing ones
are good candidates for being promoted as public interfaces (obviously after
some rework) ?


>
> I would suggest firstly deprecating AMQConnectionFactory entirely and
> making a QpidConnectionFactory interface, and having some implementations
> such as an AbstractQpidConnectionfractory parent and then
> QpidJndiConnectionFactory, QpidPropertiesFileConnectionfactory or
> QpidUrlConnectionFactory, and also a QpidConnectionFactoryHelper class with
> your static methods. We then document the static methods and the interface
> methods as public APIs, as well as any extra methods provided by the other
> implementations. Note that this gets rid of AMQP in the class name, which
> is, IMHO, a Bad Thing. I suspect most of the API will probably consist of
> constructors, or maybe static methods to get concrete implementations, and
> there's still a few more things we need to think about here in terms of API
> design.
>
> Does any of this fit in with your ideas at all?
>

I think regardless of exposing a public interface or not, we probably need
to do some refactoring along the lines you are proposing.
The JMS client is certainly in need of some refactoring, especially the
various AMQXXX classes.
However IMO any of that work should be done with keeping 1.0 in mind.

There are lots of ideas about how the restructuring should be and the timing
etc..
That is why I think it's all the more important that we come up with a very
simple interface where we can easily swap any implementation at any time
without affecting our users.
Exposing what we have now, might not help us here.


> If we do this properly, we can also improve our Spring integration, since
> the org.apache.qpid.jndi.PropertiesFileInitialContextFactory is a bit too
> generic, replacing it with the above factory concrete implementations?
>

Integration with various containers is becoming increasingly important.
There have been various queries about integrating into other jndi
mechanisms, various app servers, ESB's, containers like spring etc..
Therefore we need to consider all these possibilities when designing our
interface.



> Other classes we need to expose with proper Javadoc documentation would be
> the URL classes, which possibly need a bit of attention if we want to add
> the new JMS URL syntax as well. These can maybe all extend a generic QpidUrl
> class, with JmsUrl, BindingUrl, AddressUrl, AmqpUrl or whatever as concrete
> implementations to choose from, making it clear in the method signatures by
> accepting either a String representation or the parent QpidUrl class. This
> is Future Work, obviously, but it had occurred to me before and I don't know
> if I've mentioned it?
>

I think just like the common addressing scheme, we need to come up with a
common connection URL format across all clients.
I don't know understand why we need a client specific url.


>
> Perhaps we should designate a package (or more?) which will only contain
> public interfaces. Probably org.apache.qpid.jms is the right place for
> these? Then we just generate javadocs for this at release time, and keep the
> rest hidden. This helps with OSGi packaging too, giving a source for a list
> of our exported packages for a client bundle, the rest being private.
>
> I agree with you here.
However the above package contains all kinds of classes that probably needs
to move out to a suitable location.


>
>  I am hoping  to create a JIRA on this soon abd perhaps attach a very
>> simple
>> patch.
>> And if there are no objections, I will be tempted to commit it by the end
>> of
>> the week.
>>
>> I'd like to make sure we get it right as we need to provide a stable
>> interface between releases going forward.
>> Therefore I urge all interested folks to voice in their concerns/opinions
>> at
>> the earliest possible.
>>
>
> Voiced.
>
> I do like the idea of an API for creating connections, so a tentative +1,
> or maybe a +0.5f, assuming we also make a start on publishing our public
> APIs somewhere. A 'stable' API needs to be documented somewhere permanently
> before it can be regarded as such.
>
> Totally agree with you.
Again, I think this should be the case for all our clients, not just the
Java client.


> See the ActiveMQ site for what I think we should be aiming for:
>
>
> http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/ActiveMQConnectionFactory.html
>
> Cheerz,
> Andrew.
> --
> -- andrew d kennedy ? do not fold, bend, spindle, or mutilate ;
> -- http://grkvlt.blogspot.com/ ? edinburgh : +44 7582 293 255 ;
>
>
> ---------------------------------------------------------------------
> 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/

Re: [JMS] Creating connections & destinations dynamically

Posted by Gordon Sim <gs...@redhat.com>.
On 02/07/2011 11:55 PM, Andrew Kennedy wrote:
> Perhaps we should designate a package (or more?) which will only contain
> public interfaces.

That sounds like a good idea to me.

> Probably org.apache.qpid.jms is the right place for
> these?

I agree in principle, though some of the classes or interfaces already 
in org.apache.qpid.jms need some review in my opinion.

Pulling in definitions from other qpid packages should really be avoided 
for the approach you suggest (e.g. AMQShortString, ProtocolVersion, 
SSLConfiguration etc).

That package also includes JMS extensions. I'm not convinced that these 
are all features we should be encouraging people to use going forward. 
Certainly they are in a different category to APIs for creating 
implementations of standard JMS interfaces.

I am really not a fan of the connection url syntax the JMS client uses 
either.

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


Re: [JMS] Creating connections & destinations dynamically

Posted by Andrew Kennedy <an...@gmail.com>.
On 7 Feb 2011, at 17:00, Rajith Attapattu wrote:
> So far I have only heard positive comments about this approach.
> Does anybody have any concerns about the approach in general or any  
> comments
> about how it should be done if it's needed ?

Well, not negative, but I *do* have some questions, which are  
possibly just due to my lack of knowledge of existing documentation  
and processes.

Basically, how are we going to ensure that this new API never gets  
deprecated? Where do we state/promise these things? There isn't a  
page of Javadoc on the Qpid site showing our fixed, stable, public  
API sets. I'm aware of the docbook/PDF documentation and Java  
programming guides, but I was thinking of something more formal.  
Anyway, if we can make such a statement about your proposed API, why  
can't we just make that same statement about AMQConnectionFactory,  
and add some extra helper methods to it, as needed, documenting and  
publishing as we go? I believe the effect would be identical...

In principle, I agree we need to set up some stable APIs but, why not  
start off by documenting and improving the existing ones first, and  
then add your proposed code in there?

I would suggest firstly deprecating AMQConnectionFactory entirely and  
making a QpidConnectionFactory interface, and having some  
implementations such as an AbstractQpidConnectionfractory parent and  
then QpidJndiConnectionFactory, QpidPropertiesFileConnectionfactory  
or QpidUrlConnectionFactory, and also a QpidConnectionFactoryHelper  
class with your static methods. We then document the static methods  
and the interface methods as public APIs, as well as any extra  
methods provided by the other implementations. Note that this gets  
rid of AMQP in the class name, which is, IMHO, a Bad Thing. I suspect  
most of the API will probably consist of constructors, or maybe  
static methods to get concrete implementations, and there's still a  
few more things we need to think about here in terms of API design.

Does any of this fit in with your ideas at all?

If we do this properly, we can also improve our Spring integration,  
since the org.apache.qpid.jndi.PropertiesFileInitialContextFactory is  
a bit too generic, replacing it with the above factory concrete  
implementations?

Other classes we need to expose with proper Javadoc documentation  
would be the URL classes, which possibly need a bit of attention if  
we want to add the new JMS URL syntax as well. These can maybe all  
extend a generic QpidUrl class, with JmsUrl, BindingUrl, AddressUrl,  
AmqpUrl or whatever as concrete implementations to choose from,  
making it clear in the method signatures by accepting either a String  
representation or the parent QpidUrl class. This is Future Work,  
obviously, but it had occurred to me before and I don't know if I've  
mentioned it?

Perhaps we should designate a package (or more?) which will only  
contain public interfaces. Probably org.apache.qpid.jms is the right  
place for these? Then we just generate javadocs for this at release  
time, and keep the rest hidden. This helps with OSGi packaging too,  
giving a source for a list of our exported packages for a client  
bundle, the rest being private.

> I am hoping  to create a JIRA on this soon abd perhaps attach a  
> very simple
> patch.
> And if there are no objections, I will be tempted to commit it by  
> the end of
> the week.
>
> I'd like to make sure we get it right as we need to provide a stable
> interface between releases going forward.
> Therefore I urge all interested folks to voice in their concerns/ 
> opinions at
> the earliest possible.

Voiced.

I do like the idea of an API for creating connections, so a tentative  
+1, or maybe a +0.5f, assuming we also make a start on publishing our  
public APIs somewhere. A 'stable' API needs to be documented  
somewhere permanently before it can be regarded as such.

See the ActiveMQ site for what I think we should be aiming for:

	http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/ 
activemq/ActiveMQConnectionFactory.html

Cheerz,
Andrew.
-- 
-- andrew d kennedy ? do not fold, bend, spindle, or mutilate ;
-- http://grkvlt.blogspot.com/ ? edinburgh : +44 7582 293 255 ;

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


Re: [JMS] Creating connections & destinations dynamically

Posted by Robbie Gemmell <ro...@gmail.com>.
I think trying to clean up how people use the codebase is a good idea,
no question about that. However, as there is already a
ConnectionFactory implementation that people simply miss/ignore
already when overlooking/ignoring JNDI I do wonder if providing a
ConnectionFactory..Factory..is actually going to change their
behaviour?

Robbie

On 7 February 2011 17:00, Rajith Attapattu <ra...@gmail.com> wrote:
> So far I have only heard positive comments about this approach.
> Does anybody have any concerns about the approach in general or any comments
> about how it should be done if it's needed ?
>
> I am hoping  to create a JIRA on this soon abd perhaps attach a very simple
> patch.
> And if there are no objections, I will be tempted to commit it by the end of
> the week.
>
> I'd like to make sure we get it right as we need to provide a stable
> interface between releases going forward.
> Therefore I urge all interested folks to voice in their concerns/opinions at
> the earliest possible.
>
> Regards,
>
> Rajith.
>
> On Mon, Feb 7, 2011 at 10:46 AM, Andrew Stitcher <as...@redhat.com>wrote:
>
>> On Fri, 2011-02-04 at 11:22 -0500, Rajith Attapattu wrote:
>> > Hi,
>> >
>> > Some Qpid users like to create connections and destinations dynamically
>> > instead of using the jndi.properties file.
>> > All though there is a reasonable way of creating Queues and Topics using
>> > session.createQueue and session.createTopic respectively, there is
>> currently
>> > no proper way of creating connections.
>> >
>> > Therefore people resort to using AMQConnection class., which is less than
>> > ideal.
>> > Chances are that this class can change, get deprecated in favour of a
>> better
>> > implementation etc.. in a future release.
>> >
>> > Perhaps we should provide a stable API for creating connections without
>> > having to use internal implementation specific classes for folks who want
>> to
>> > do it dynamically.
>> > Maybe something along the lines of,
>> >
>> > Qpid {
>> >
>> > public javax.jms.ConnectionFactory createConnectionFactory(String user,
>> > String password);
>> >
>> > public javax.jms.ConnectionFactory createConnectionFactory(String url);
>> >
>> > public javax.jms.Connection createConnection(String user, String
>> password);
>> >
>> > public javax.jms.Connection createConnection(String url);
>> >
>> > public javax.jms.Destination(String addr);
>> >
>> > }
>> >
>> > That way we can shield a Qpid user from changes in a reasonable way.
>> > However we need to impress upon our users that the preferred way is to
>> use
>> > the JNDI mechanism.
>> > On the other hand users could use the above mechanism to create
>> connections
>> > and destinations and inject them into their preferred JNDI mechanism
>> rather
>> > than using our JNDI implementation.
>>
>> An important place where this would be used would be infrastructure
>> code; a good example would be the JCA adapter.
>>
>> Andrew
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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: [JMS] Creating connections & destinations dynamically

Posted by Rajith Attapattu <ra...@gmail.com>.
So far I have only heard positive comments about this approach.
Does anybody have any concerns about the approach in general or any comments
about how it should be done if it's needed ?

I am hoping  to create a JIRA on this soon abd perhaps attach a very simple
patch.
And if there are no objections, I will be tempted to commit it by the end of
the week.

I'd like to make sure we get it right as we need to provide a stable
interface between releases going forward.
Therefore I urge all interested folks to voice in their concerns/opinions at
the earliest possible.

Regards,

Rajith.

On Mon, Feb 7, 2011 at 10:46 AM, Andrew Stitcher <as...@redhat.com>wrote:

> On Fri, 2011-02-04 at 11:22 -0500, Rajith Attapattu wrote:
> > Hi,
> >
> > Some Qpid users like to create connections and destinations dynamically
> > instead of using the jndi.properties file.
> > All though there is a reasonable way of creating Queues and Topics using
> > session.createQueue and session.createTopic respectively, there is
> currently
> > no proper way of creating connections.
> >
> > Therefore people resort to using AMQConnection class., which is less than
> > ideal.
> > Chances are that this class can change, get deprecated in favour of a
> better
> > implementation etc.. in a future release.
> >
> > Perhaps we should provide a stable API for creating connections without
> > having to use internal implementation specific classes for folks who want
> to
> > do it dynamically.
> > Maybe something along the lines of,
> >
> > Qpid {
> >
> > public javax.jms.ConnectionFactory createConnectionFactory(String user,
> > String password);
> >
> > public javax.jms.ConnectionFactory createConnectionFactory(String url);
> >
> > public javax.jms.Connection createConnection(String user, String
> password);
> >
> > public javax.jms.Connection createConnection(String url);
> >
> > public javax.jms.Destination(String addr);
> >
> > }
> >
> > That way we can shield a Qpid user from changes in a reasonable way.
> > However we need to impress upon our users that the preferred way is to
> use
> > the JNDI mechanism.
> > On the other hand users could use the above mechanism to create
> connections
> > and destinations and inject them into their preferred JNDI mechanism
> rather
> > than using our JNDI implementation.
>
> An important place where this would be used would be infrastructure
> code; a good example would be the JCA adapter.
>
> Andrew
>
>
>
> ---------------------------------------------------------------------
> 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/

Re: [JMS] Creating connections & destinations dynamically

Posted by Andrew Stitcher <as...@redhat.com>.
On Fri, 2011-02-04 at 11:22 -0500, Rajith Attapattu wrote:
> Hi,
> 
> Some Qpid users like to create connections and destinations dynamically
> instead of using the jndi.properties file.
> All though there is a reasonable way of creating Queues and Topics using
> session.createQueue and session.createTopic respectively, there is currently
> no proper way of creating connections.
> 
> Therefore people resort to using AMQConnection class., which is less than
> ideal.
> Chances are that this class can change, get deprecated in favour of a better
> implementation etc.. in a future release.
> 
> Perhaps we should provide a stable API for creating connections without
> having to use internal implementation specific classes for folks who want to
> do it dynamically.
> Maybe something along the lines of,
> 
> Qpid {
> 
> public javax.jms.ConnectionFactory createConnectionFactory(String user,
> String password);
> 
> public javax.jms.ConnectionFactory createConnectionFactory(String url);
> 
> public javax.jms.Connection createConnection(String user, String password);
> 
> public javax.jms.Connection createConnection(String url);
> 
> public javax.jms.Destination(String addr);
> 
> }
> 
> That way we can shield a Qpid user from changes in a reasonable way.
> However we need to impress upon our users that the preferred way is to use
> the JNDI mechanism.
> On the other hand users could use the above mechanism to create connections
> and destinations and inject them into their preferred JNDI mechanism rather
> than using our JNDI implementation.

An important place where this would be used would be infrastructure
code; a good example would be the JCA adapter.

Andrew



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


Re: [JMS] Creating connections & destinations dynamically

Posted by "Weston M. Price" <wp...@redhat.com>.
On Feb 4, 2011, at 11:22 AM, Rajith Attapattu wrote:

> Hi,
> 
> Some Qpid users like to create connections and destinations dynamically
> instead of using the jndi.properties file.
> All though there is a reasonable way of creating Queues and Topics using
> session.createQueue and session.createTopic respectively, there is currently
> no proper way of creating connections.
> 
> Therefore people resort to using AMQConnection class., which is less than
> ideal.
> Chances are that this class can change, get deprecated in favour of a better
> implementation etc.. in a future release.
> 
> Perhaps we should provide a stable API for creating connections without
> having to use internal implementation specific classes for folks who want to
> do it dynamically.
> Maybe something along the lines of,
> 
> Qpid {
> 
> public javax.jms.ConnectionFactory createConnectionFactory(String user,
> String password);
> 
> public javax.jms.ConnectionFactory createConnectionFactory(String url);
> 
> public javax.jms.Connection createConnection(String user, String password);
> 
> public javax.jms.Connection createConnection(String url);
> 
> public javax.jms.Destination(String addr);
> 
> }
> 
> That way we can shield a Qpid user from changes in a reasonable way.
> However we need to impress upon our users that the preferred way is to use
> the JNDI mechanism.
> On the other hand users could use the above mechanism to create connections
> and destinations and inject them into their preferred JNDI mechanism rather
> than using our JNDI implementation.
> 
> Thoughts ?
> 
Seems reasonable. The JMS spec even allows for this, in that while JNDI is recommended via admin objects, nothing forces it's use. Seems like a reasonable feature for our clients that don't want to contend with JNDI.

Regards,

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