Connecting to WebSphere MQ over TCP/IP

You can connect to a WebSphere® MQ server from EGL-generated Java™ code or the debugger, by using only the WebSphere MQ .jar files, over a TCP/IP connection.

The alternative requires that you install a number of shared libraries that the WebSphere MQ .jar files depend on. Connecting over TCP/IP makes it easier to distribute the program by making an installer unnecessary.

The TCP/IP connection does require specific code in your EGL program, as in the example.

Example

The first example defines an ExternalType part to use with a TCP/IP connection:

ExternalType MQEnvironment type JavaObject { packageName = "com.ibm.mq" }
  static hostname string;
  static port int;
  static channel string;
end

The second example shows sample values for the fields in the ExternalType part. Set these values before using any WebSphere MQ I/O statements:

function beforeConnectingToMQ()
  MQEnvironment.hostname = "myserver.mycompany.com";
  MQEnvironment.port = 1492;
  MQEnvironment.channel = "mychannel";
end