[progress Communities] [progress Openedge Abl] Forum Post: Re: Connect To Websphere Mq...

  • Thread starter Thread starter Fuelfire
  • Start date Start date
Status
Not open for further replies.
F

Fuelfire

Guest
Anand, great thanks! Now I have time to continue. I must communicate with remote WebSphereMQ server. And I must develop AdminObjectFinder class. I'm not very good in Java. As I understand, this file allows me to configure the connection settings to the WebSphereMQ server. Do I understand correctly that I don't need to install SonicMQ adapter on the server for working with WebSphere MQ? You write that I must start SonicMQ adapter and specify sonicMQ1 in command. But in my OEM I don't see any sonicMQ adapters. Moreover, I did not install Sonic ESB adapter on the database server. Is it necessary? I'm looking at an example file in the documentation: package jmsfromABL; import javax.jms.ConnectionFactory; import javax.jms.Destination; import javax.jms.TopicConnectionFactory; import javax.jms.QueueConnectionFactory; import javax.jms.Topic; import javax.jms.Queue; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NameNotFoundException; import javax.naming.NamingException; import java.util.Hashtable; public class AdminObjectFinder{ public Context context = null; public AdminObjectFinder() throws Exception{ Hashtable env = new Hashtable<>(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory"); env.put(Context.PROVIDER_URL, "file:/C:/JNDI"); env.put(Context.SECURITY_PRINCIPAL, "username"); env.put(Context.SECURITY_CREDENTIALS, "password"); context = new InitialContext(env); } public TopicConnectionFactory getTopicConnectionFactory(String name) throws Exception { TopicConnectionFactory factory = null; factory = (javax.jms.TopicConnectionFactory)context.lookup(name); return factory; } public QueueConnectionFactory getQueueConnectionFactory(String name) throws Exception { QueueConnectionFactory factory = null; factory = (javax.jms.QueueConnectionFactory)context.lookup(name); return factory; } public ConnectionFactory getConnectionFactory(String name) throws NamingException { return (ConnectionFactory) context.lookup(name); } public Topic getTopic(String name) throws Exception { Topic topic = null; Object object = null; object = context.lookup(name); if (object != null) { topic = (javax.jms.Topic) object; } return topic; } public Queue getQueue(String name) throws Exception { Queue queue = null; Object object = null; object = context.lookup(name); if (object != null) { queue = (javax.jms.Queue) object; } return queue; } public Destination getDestination(String name) throws NamingException { return (Destination) context.lookup(name); } } As I understand I must specify in this text URL of MQ Server (PROVIDER_URL), login (SECURITY_PRINCIPAL) and password (SECURITY_CREDENTIALS). Then I must create class with javac and after that pack it in jar. Then I place it in pluginclass and classpath under [PluginPolicy.Progress.SonicMQ]. Is that enough? Or Websphere admin must tell me also INITIAL_CONTEXT_FACTORY ?

Continue reading...
 
Status
Not open for further replies.
Back
Top