users@glassfish.java.net

Re: JMS remote client

From: Sivakumar Thyagarajan <Sivakumar.Thyagarajan_at_Sun.COM>
Date: Thu, 20 Dec 2007 16:47:38 +0530

>> question 2: The size of the jars I need to bundle with our apps
>> is huge!! Namely the appserv-rt.jar is 15m. Not to mention that
>> it contains some apache classes that conflict with our code. Is
>> there some other reference to the dependencies other than what's
>> listed in:
>> https://glassfish.dev.java.net/javaee5/docs/DG/beakt.html#beakx

No, unfortunately access to JMS resources from a standalone java
client, requires all those jars.

Thanks
--Siva.

glassfish_at_javadesktop.org wrote:
> Hi,
>
> I'm about to install a jms client on some applications that are running on Resin. The jms brokers will be running on 2 instances of glassfish.
>
>
> question 1: I'm concerned about using our DAS in the provider url. It will become the single point of failure. Is there a smart way to get the jndiContext when it's not running on the local machine? Or maybe the question should be can I, some how, lookup objects in glassfish from resin's initialContext?
>
> question 2: The size of the jars I need to bundle with our apps is huge!! Namely the appserv-rt.jar is 15m. Not to mention that it contains some apache classes that conflict with our code. Is there some other reference to the dependencies other than what's listed in: https://glassfish.dev.java.net/javaee5/docs/DG/beakt.html#beakx
>
>
> working sample client code:
> Properties props = new Properties();
> props.setProperty("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory");
> props.setProperty("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");
> props.setProperty("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
> props.setProperty("java.naming.provider.url", "ourDasServer");
> Context jndiContext = new InitialContext(props);
>
> QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory) jndiContext.lookup("jms/QueueConnectionFactory");
> Queue queue = (Queue) jndiContext.lookup("jms/taleOmpQueue");
> QueueConnection queueCon = null;
>
> try {
> queueCon = queueConnectionFactory.createQueueConnection();
> QueueSession session = queueCon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
> QueueSender sender = session.createSender(queue);
> Visitor visitor = null;//removed
> ObjectMessage message = session.createObjectMessage(visitor);
> sender.send(message);
> sender.send(session.createMessage());
> }
> finally {
>
> if (queueCon != null)
> queueCon.close();
> }
>
>
> Thanks In Advance
> Michael
> [Message sent by forum member 'mfortin' (mfortin)]
>
> http://forums.java.net/jive/thread.jspa?messageID=250650
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>