Obtaining IBM MQ JMS resources in the thin client environment

A stand-alone Java™ SE JMS thin client application that connects to an external IBM MQ queue manager can get administratively-created IBM MQ messaging provider JMS resources from the WebSphere® Application Server Java Naming and Directory Interface (JNDI) namespace.

Procedure

  1. To obtain IBM MQ messaging provider JMS resources from the WebSphere Application Server JNDI namespace in the thin client environment, include the following jar files in the runtime classpath of your application:
    • A copy of the /runtimes/com.ibm.ws.ejb.thinclient_8.5.0.jar file.
    • A copy of the /runtimes/com.ibm.ws.messagingClient.jar file.
    • IBM MQ client jar files, which must be obtained from the IBM MQ product.
  2. Use the following code to create a suitable Initial Context, substituting the server IP address and port as appropriate:
    import javax.naming.*;
    ...
    Properties env = new Properties();
    env.put(Context.PROVIDER_URL,"iiop:
      //<server IP address>:<server bootstrap address port>");
    env.put(Context.INITIAL_CONTEXT_FACTORY,
      "com.ibm.websphere.naming.WsnInitialContextFactory");
    InitialContext ctx = new InitialContext(env);
    In certain situations, for example when running with a Sun JRE, an additional ORB jar is also required. For additional information about when this jar is required, see the Thin Client for EJB with WebSphere Application Server information.

Ícone que indica o tipo de tópico Tópico de Tarefa



Ícone de registro de data e hora Última atualização: July 9, 2016 7:54
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=tjj_jmsthcli_wmq
Nome do arquivo: tjj_jmsthcli_wmq.html