Re: JMS ConnectionFactory

2008-12-10 Thread David Blevins


On Dec 5, 2008, at 8:46 AM, Oliver Günther wrote:

Also, if the server should use the same ConnectionFactory as the  
remote

client (which is needed, then the client and and a server bean what to
send/receive messages on the same topic/queue) the openejb.xml needs  
to be

changed:


 BrokerXmlConfig broker:(tcp://localhost:61616)?useJmx=false
 #ServerUrl vm://localhost?async=true
 ServerUrl tcp://localhost:61616
 DataSource My Unmanaged DataSource


Don't know if this can also be done via properties ?!


Any of the properties in an openejb.xml can be overridden as stated in  
the docs.  It gets a little clunky with spaces but is still doable:


 -DMy\ JMS\ Resource\ Adapter.ServerUrl=tcp://localhost:61616


-David



Re: JMS ConnectionFactory

2008-12-05 Thread Oliver Günther

Thanx and I also would like to see that in the faq. 

To complete the topic, the following things should be noted. 
Even easier, an AciveMQ Connection can be made via: 
ActiveMQConnection.makeConnection("tcp://ws-gl-og:61616");

Also, if the server should use the same ConnectionFactory as the remote
client (which is needed, then the client and and a server bean what to
send/receive messages on the same topic/queue) the openejb.xml needs to be
changed:


  BrokerXmlConfig broker:(tcp://localhost:61616)?useJmx=false
  #ServerUrl vm://localhost?async=true
  ServerUrl tcp://localhost:61616
  DataSource My Unmanaged DataSource


Don't know if this can also be done via properties ?!


Dain Sundstrom wrote:
> 
> Excellent answer.  You should throw this into the faq
> (http://openejb.apache.org/faq.html 
> )
> 
> -dain
> 
> 


-
Olli
-- 
View this message in context: 
http://www.nabble.com/JMS-ConnectionFactory-tp20610921p20857906.html
Sent from the OpenEJB User mailing list archive at Nabble.com.



Re: JMS ConnectionFactory

2008-12-03 Thread Dain Sundstrom
Excellent answer.  You should throw this into the faq (http://openejb.apache.org/faq.html 
)


-dain

On Nov 27, 2008, at 5:29 AM, Jonathan Gallimore wrote:

I don't think there's an OpenEJB specific way to lookup the  
connection factory, but you could deploy a session bean like the  
MessageClientBean in the simple-mdb sample (https://svn.apache.org/repos/asf/openejb/trunk/openejb3/examples/simple-mdb/src/main/java/org/superbiz/mdb/MessagingClientBean.java 
) which handles the messaging for you, and call that from your  
remote client.


Alternatively you could try getting the connection factory directly  
from ActiveMQ as follows:


Properties properties = new Properties();
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,  
"org.apache.activemq.jndi.ActiveMQInitialContextFactory");

properties.setProperty(Context.PROVIDER_URL, "tcp://localhost:61616");
 InitialContext context = new InitialContext(properties);
ConnectionFactory cf = (ConnectionFactory)  
context.lookup("ConnectionFactory");



Hope that helps,

Jon


Oliver Günther wrote:

And how do I get the connectionFactory on the Remote Client ?


Dain Sundstrom wrote:

Create a field like this in your EJB (or Servlet in Tomcat  
embedded  mode).


@Resource
ConnectionFactory connectionFactory;

IIRC the JNDI name of the connectionFactory is logged during  
setup,  but I suggest you use injection instead of JNDI as it is  
way more  portable.


-dain

On Nov 20, 2008, at 12:09 PM, Oliver Günther wrote:



Hi,

if OpenEJB running in embedded and remoteable mode are there any  
JMS
ConnectionFactory's via JINI requestable and what are the  
default  names.


-
Olli













Re: JMS ConnectionFactory

2008-11-27 Thread Jonathan Gallimore
I don't think there's an OpenEJB specific way to lookup the connection 
factory, but you could deploy a session bean like the MessageClientBean 
in the simple-mdb sample 
(https://svn.apache.org/repos/asf/openejb/trunk/openejb3/examples/simple-mdb/src/main/java/org/superbiz/mdb/MessagingClientBean.java) 
which handles the messaging for you, and call that from your remote client.


Alternatively you could try getting the connection factory directly from 
ActiveMQ as follows:


Properties properties = new Properties();
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, 
"org.apache.activemq.jndi.ActiveMQInitialContextFactory");

properties.setProperty(Context.PROVIDER_URL, "tcp://localhost:61616");
  
InitialContext context = new InitialContext(properties);
ConnectionFactory cf = (ConnectionFactory) 
context.lookup("ConnectionFactory");



Hope that helps,

Jon


Oliver Günther wrote:

And how do I get the connectionFactory on the Remote Client ?


Dain Sundstrom wrote:
  
Create a field like this in your EJB (or Servlet in Tomcat embedded  
mode).


@Resource
ConnectionFactory connectionFactory;

IIRC the JNDI name of the connectionFactory is logged during setup,  
but I suggest you use injection instead of JNDI as it is way more  
portable.


-dain

On Nov 20, 2008, at 12:09 PM, Oliver Günther wrote:



Hi,

if OpenEJB running in embedded and remoteable mode are there any JMS
ConnectionFactory's via JINI requestable and what are the default  
names.


-
Olli
  





  




Re: JMS ConnectionFactory

2008-11-27 Thread Oliver Günther

And how do I get the connectionFactory on the Remote Client ?


Dain Sundstrom wrote:
> 
> Create a field like this in your EJB (or Servlet in Tomcat embedded  
> mode).
> 
> @Resource
> ConnectionFactory connectionFactory;
> 
> IIRC the JNDI name of the connectionFactory is logged during setup,  
> but I suggest you use injection instead of JNDI as it is way more  
> portable.
> 
> -dain
> 
> On Nov 20, 2008, at 12:09 PM, Oliver Günther wrote:
> 
>> Hi,
>>
>> if OpenEJB running in embedded and remoteable mode are there any JMS
>> ConnectionFactory's via JINI requestable and what are the default  
>> names.
>>
>> -
>> Olli
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/JMS-ConnectionFactory-tp20610921p20717939.html
Sent from the OpenEJB User mailing list archive at Nabble.com.



Re: JMS ConnectionFactory

2008-11-24 Thread Dain Sundstrom
Create a field like this in your EJB (or Servlet in Tomcat embedded  
mode).


@Resource
ConnectionFactory connectionFactory;

IIRC the JNDI name of the connectionFactory is logged during setup,  
but I suggest you use injection instead of JNDI as it is way more  
portable.


-dain

On Nov 20, 2008, at 12:09 PM, Oliver Günther wrote:


Hi,

if OpenEJB running in embedded and remoteable mode are there any JMS
ConnectionFactory's via JINI requestable and what are the default  
names.


-
Olli




JMS ConnectionFactory

2008-11-20 Thread Oliver Günther
Hi,

if OpenEJB running in embedded and remoteable mode are there any JMS
ConnectionFactory's via JINI requestable and what are the default names.

-
Olli