tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: How to reference connection factory and queues from code
Date Tue, 08 Sep 2015 03:24:36 GMT
still inline ;)

2015-09-07 20:14 GMT-07:00 hkgot <harikrishna@gmail.com>:

> "ConnectionFactory can be defined using a custom resource
> (with class-name), I guess for remote connections it can be the best
> solution but if parts of your ear are communicating together using local
> transport would make smooth to just reuse the same server resources."
>
> If I understand this correct, you are suggesting to reuse server resources
> both from server and remote client. Right? If yes, how do I reuse/reference
> the same server resources from remote client code?
>
>
this was my question, is "parts" of your ear are in the same JVM you just
reference them using the id as name in @Resource. If not this still works
for destinations but for connection factories you need to use next trick.


> Sorry, I couldn't understand custom resource (with class-name) - could you
> elobarate more on this? Thx.
>
>
>
In TomEE you can define a @Resource using: <Resource id="..."
class-name="xxxx">props as usual</Resource>.

This will do a new xxx(); and match properties using xxx setters. This
allows you to use any type as injection in your app. I would use it to
build a full client connection factory instead of relying on a server one
(see activemq doc for more details on the difference between the resource
adapter and the clients).


>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/How-to-reference-connection-factory-and-queues-from-code-tp4675980p4676158.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message