posted 16 years ago
I am a newbie on MQseries.
I am programming a client JMS that run on windows side . And the server MQSeries is on the Linux OS.
From the Linux I used JMSAdmin to create my administrated object ( QManager, Myqueue, myQCF etc...). A file .bindings is generated on the /var/mqm/.bindings.
How to use that file .bindings side client (ie JMS on windows ) in order to communicate the client and the server.
Thanks
here my code
Hashtable env;
InitialContext context;
QueueConnectionFactory qcf;
QueueConnection connection;
Queue queue;
env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, INITIAL_CONTEXT_FACTORY);
env.put(Context.PROVIDER_URL, PROVIDER_URL);
env.put(Context.SECURITY_AUTHENTICATION,SECU);
try {
context = new InitialContext(env);
qcf = (javax.jms.QueueConnectionFactory)context.lookup(QUEUE_CONNECTION_FACTORY);
connection = qcf.createQueueConnection();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
queue = session.createQueue("MYQUEUE");
MessageProducer sender = session.createProducer(queue);
TextMessage mess = session.createTextMessage("test MQSeries ould nadif");
sender.send(mess);
session.close();
connection.close();
//...
}
catch (javax.naming.NamingException ne) {
ne.printStackTrace();
}
catch (javax.jms.JMSException jms) {
jms.printStackTrace();
}
}
We are ones that build the world, thus build it well.