users@glassfish.java.net

JMS remote client

From: <glassfish_at_javadesktop.org>
Date: Tue, 18 Dec 2007 13:56:28 PST

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