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.

指出主題類型的圖示 作業主題



時間戳記圖示 前次更新: July 9, 2016 11:15
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=tjj_jmsthcli_wmq
檔名:tjj_jmsthcli_wmq.html