2016-10-03 2 views
0

Ich habe Probleme, Tibco EMS in Java zu integrieren. Wenn jemand Erfahrung hat, rate mir bitte, es zu tun. Ich habe folgende Kodierung gemacht, aber ich weiß nicht, den nächsten Schritt fortzusetzen.Tibco ems Integration mit JMS

Context jndiContext = null; 
ConnectionFactory cFactory = null; 
Connection conn = null; 
Session session = null; 
Hashtable<String, String> env = new Hashtable<String, String>(); 
env.put(Context.INITIAL_CONTEXT_FACTORY, 
     "com.tibco.tibjms.naming.TibjmsInitialContextFactory"); 
env.put(Context.PROVIDER_URL, "http://10.6.136.141:8222"); 
jndiContext = new InitialContext(env); 
cFactory = (ConnectionFactory) jndiContext.lookup("FTQueueConnectionFactory"); 
conn = cFactory.createConnection("loyalty", "loyalty"); 
session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE); 

Antwort

0

Keine Notwendigkeit zur Einrichtung JNDI, wenn Sie es nicht brauchen. Nutzen Sie einfach die TibjmsConnectionFactory Klasse:

ConnectionFactory factory = new com.tibco.tibjms.TibjmsConnectionFactory("tcp://localhost:7222"); 
connection = factory.createConnection(userName, password); 
connection.start(); 
session = connection.createSession(javax.jms.Session.AUTO_ACKNOWLEDGE); 
destination = session.createQueue(name); 
Verwandte Themen