| From | Sent On | Attachments |
|---|---|---|
| glas...@javadesktop.org | Oct 7, 2010 1:04 pm | |
| Dominik Dorn | Oct 11, 2010 1:29 pm | |
| glas...@javadesktop.org | Oct 18, 2010 4:07 am | |
| glas...@javadesktop.org | Oct 18, 2010 4:25 am | |
| glas...@javadesktop.org | Oct 18, 2010 9:30 am | |
| glas...@javadesktop.org | Oct 19, 2010 11:25 am | |
| glas...@javadesktop.org | Oct 20, 2010 2:48 am | |
| glas...@javadesktop.org | Oct 20, 2010 1:50 pm |
| Subject: | glassfish v3 jms | |
|---|---|---|
| From: | glas...@javadesktop.org (glas...@javadesktop.org) | |
| Date: | Oct 7, 2010 1:04:03 pm | |
| List: | net.java.dev.glassfish.users | |
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']





