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.

Icon that indicates the type of topic Task topic



Timestamp icon Last updated: March 5, 2017 17:27
File name: tjj_jmsthcli_wmq.html