Tag: openmq

远程访问OpenMQ

我在本地安装了openMQ,它工作正常。 我使用以下代码来使用JNDI查找来获取QueueConnectionFactory 。 Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY,”com.sun.jndi.fscontext.RefFSContextFactory”); env.put(Context.PROVIDER_URL, “file:///C:/objectstore”); Context ctx = new InitialContext(env); QueueConnectionFactory myFactory = (QueueConnectionFactory) ctx.lookup(“MyQueueConnection”); 以上返回我连接工厂,我也访问了replyQueue和requestQueue 。 这是我设置队列的方式 imqobjmgr add -l “MyQueueConnection”” -j “java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContext Factory” -j “java.naming.provider.url=file:///C://objectstore” -t qf -o “imqAddressList=mq://localhost:7676/jms” imqobjmgr add -l “cn=DEVL.REQUEST” -j “java.naming.factory.initial=com.sun.jndi.fscontext.RefFSCon textFactory” -j “java.naming.provider.url=file:///C://objectstore” -tq -o “imqDestinationName=requestQueue” imqobjmgr add -l “cn=DEVL.REPLY” -j “java.naming.factory.initial=com.sun.jndi.fscontext.RefFSConte […]