[ 
https://issues.apache.org/jira/browse/ARTEMIS-4716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17838011#comment-17838011
 ] 

Daniel Martin edited comment on ARTEMIS-4716 at 4/17/24 7:38 AM:
-----------------------------------------------------------------

{quote}integrating 3rd party implementations (...) [is] fairly common with 
messaging. It's quite common to integrate a 3rd party JMS implementation with 
an EE application server
{quote}
If so, then surely it must be easy to get hold of some real-world examples of 
people having integrated it.
{quote}To be clear, there is nothing EE-specific about the 
{{artemis-jakarta-client}} package. In fact, I would say its main use-case is 
in a Java SE context.
{quote}
This is extremely confusing. There is no such thing as "Jakarta SE", only 
"Jakarta EE". Your package being named "jakarta" is where all my expectations 
come from...
{quote}Using Jakarta classes really has nothing to do with CDI. Those two 
things are mutually exclusive. Furthermore, I'm not sure if using CDI vs. 
manual JNDI lookups is more robust or necessarily recommended more highly. I 
see CDI mainly as a convenience for developers and not much more. I don't do a 
lot of EE programming these days so maybe there's more to it that I'm not 
familiar with.
{quote}
CDI is definitely more prevalent than JNDI in my experience. And a library 
author should value convenience, don't you think? In any event, CDI or JNDI, 
I'm not picky, as long as there are clear instructions stating the preferred 
way to use the library. What I'm truly after is avoiding manual resource 
management, which is one of the benefits of dependency injection. But 
integrating with Jakarta definitely goes beyond implementing Jakarta 
interfaces, in my opinion.
{quote}ActiveMQ Artemis is the JMS implementation shipped with 
[WildFly|https://www.wildfly.org/].
{quote}
This is not quite what I meant. I don't think I can quite use WildFly as a 
template to integrate "artemis-jakarta-client" in my application, can I? I see 
hundreds and hundreds of lines related to ActiveMQ in it, but I wouldn't expect 
to have to do the same. What I meant is, does any project _using_ a Jakarta EE 
implementation (one that doesn't already come with ActiveMQ, obviously) ever 
used "artemis-jakarta-client" with dependency injection (or even at all)?
{quote}If all you're doing is injecting an ActiveMQ Artemis 
{{ConnectionFactory}} then you'll need to inform the application server about 
how to actually instantiate that object. (...) This is beyond the scope of the 
ActiveMQ Artemis documentation.
{quote}
I understand this, now I need to know how, which is why I'm looking for an 
example of somebody having done it before, if this ever happened. You presume 
it is possible, but how do you know? You must have tested it at some point, 
right? I don't know why you see this as beyond the scope of Artemis' 
documentation, it is definitely useful to know how to use the 
"artemis-jakarta-client" package. Without even one usage example, it makes 
using the package very hard. But then again, maybe is just the name of the 
package which is wrong, and none of my expectations hold because it isn't 
really meant to be an integration of Artemis with Jakarta (EE).


was (Author: JIRAUSER290941):
{quote}integrating 3rd party implementations (...) [is] fairly common with 
messaging. It's quite common to integrate a 3rd party JMS implementation with 
an EE application server
{quote}
If so, then surely it must be easy to get hold of some real-world examples of 
people having integrated it.
{quote}To be clear, there is nothing EE-specific about the 
{{artemis-jakarta-client}} package. In fact, I would say its main use-case is 
in a Java SE context.
{quote}
This is extremely confusing. There is no such thing as "Jakarta SE", only 
"Jakarta EE". You package being named "jakarta" is where all my expectations 
come from...
{quote}Using Jakarta classes really has nothing to do with CDI. Those two 
things are mutually exclusive. Furthermore, I'm not sure if using CDI vs. 
manual JNDI lookups is more robust or necessarily recommended more highly. I 
see CDI mainly as a convenience for developers and not much more. I don't do a 
lot of EE programming these days so maybe there's more to it that I'm not 
familiar with.
{quote}
CDI is definitely more prevalent than JNDI in my experience. And a library 
author should value convenience, don't you think? In any event, CDI or JNDI, 
I'm not picky, as long as there are clear instructions stating the preferred 
way to use the library. What I'm truly after is avoiding manual resource 
management, which is one of the benefits of dependency injection. But 
integrating with Jakarta definitely goes beyond implementing Jakarta 
interfaces, in my opinion.
{quote}ActiveMQ Artemis is the JMS implementation shipped with 
[WildFly|https://www.wildfly.org/].
{quote}
This is not quite what I meant. I don't think I can quite use WildFly as a 
template to integrate "artemis-jakarta-client" in my application, can I? I see 
hundreds and hundreds of lines related to ActiveMQ in it, but I wouldn't expect 
to have to do the same. What I meant is, does any project _using_ a Jakarta EE 
implementation (one that doesn't already come with ActiveMQ, obviously) ever 
used "artemis-jakarta-client" with dependency injection (or even at all)?
{quote}If all you're doing is injecting an ActiveMQ Artemis 
{{ConnectionFactory}} then you'll need to inform the application server about 
how to actually instantiate that object. (...) This is beyond the scope of the 
ActiveMQ Artemis documentation.
{quote}
I understand this, now I need to know how, which is why I'm looking for an 
example of somebody having done it before, if this ever happened. You presume 
it is possible, but how do you know? You must have tested it at some point, 
right? I don't know why you see this as beyond the scope of Artemis' 
documentation, it is definitely useful to know how to use the 
"artemis-jakarta-client" package. Without even one usage example, it makes 
using the package very hard. But then again, maybe is just the name of the 
package which is wrong, and none of my expectations hold because it isn't 
really meant to be an integration of Artemis with Jakarta (EE).

> Improve Jakarta Messaging / JMS documentation
> ---------------------------------------------
>
>                 Key: ARTEMIS-4716
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4716
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: JMS
>    Affects Versions: 2.33.0
>            Reporter: Daniel Martin
>            Priority: Minor
>
> I'm struggling to understand [these 
> instructions|https://activemq.apache.org/components/artemis/documentation/latest/using-jms.html]
>  to use Artemis in the context of Jakarta Messaging which perhaps could be 
> updated / simplified / improved.
> At the moment, I'm depending on {{artemis-jakarta-client}} and manually 
> instantiating {{ActiveMQConnectionFactory}}. While investigating a memory 
> leak that may come from my usage of ActiveMQ, I wanted to simplify this part 
> and rely on dependency injection instead. However, I don't begin to 
> understand how to do such thing.
> My expectation was to be able to use the {{@Inject}} annotation to get a 
> reference to a {{ConnectionFactory}}, {{JMSContext}}, or similar and to be 
> able to provide configuration such as broker address and credentials 
> _somewhere_ as to end up with a reference to a {{Connection}} which is 
> ultimately what I need. Is this possible? What's the recommended way? Is 
> there any (working) reference examples?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to