users@glassfish.java.net

Re: glassfish v3 jms

From: Dominik Dorn <dominik.dorn_at_gmail.com>
Date: Mon, 11 Oct 2010 22:30:04 +0200

nothing.
you have to configure your connectionFactory
with the admin console and specify that it's on a remote host.



On Thu, Oct 7, 2010 at 10:04 PM, <glassfish_at_javadesktop.org> wrote:
> What do i have to change in this code, if my Quote is on another Host(ip: 10.73.0.9)?
>
> My english is not good, but i don't find the solution in web.
>
> Thanks.
> Cassio.
>
>
>
> try {
>            jndiContext = new InitialContext();
>            System.out.println("CONEXAO");
>            connectionFactory = (ConnectionFactory)jndiContext.lookup("jms/CF");
>            queue = (Queue)jndiContext.lookup("jms/Queue");
>            connection = connectionFactory.createConnection();
>            session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
>            messageProducer = session.createProducer(queue);
>            // object that will send
>            Quotes quote = new Quotes("^BVSP", new Date(), counter++, 0, 0, 0, (int)(Math.random() * 100));
>            msg = session.createObjectMessage(quote);
>            msg.setStringProperty("symbol", quote.symbol);
>            msg.setFloatProperty("volume", quote.volume);
>                        // send object
>            messageProducer.send(msg);
>            connection.close();
> } catch (NamingException e) {
>            Logger.getLogger(JMSEnvio.class.getName()).log(Level.SEVERE, null, e);
> }
>        catch (JMSException e) {
>            Logger.getLogger(JMSEnvio.class.getName()).log(Level.SEVERE, null, e);
> } finally {
>            System.out.println("ENDED.");
>            //System.out.println("PROVIDER_URL: " + properties.get(Context.PROVIDER_URL));
>            if (connection != null) connection.close();
> }
> [Message sent by forum member 'cassionoronha']
>
> http://forums.java.net/jive/thread.jspa?messageID=484573
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>



-- 
Dominik Dorn
http://dominikdorn.com
http://twitter.com/domdorn
Tausche Deine Lernunterlagen auf http://www.studyguru.eu !