Define outbound chains for WebSphere MQ interoperation
We can define new outbound chains using the wsadmin utility. These chains can be used for interoperating with WebSphere MQ.
The channels used to build an outbound chain determine with which configurations of the WebSphere MQ queue manager sender channel so a network connection can be successfully established. The following table shows all the valid chain configurations and describes the configuration of aWebSphere MQ queue manager sender channel with which they can be used to establish a connection.
manager sender channel configurations. The first column of the table provides the WebSphere MQ channels. The second to fourth columns in the table indicate whether the TCP, SSL, and MQFAP channels in combination with the WebSphere MQ channel can establish a network connection successfully. It is important to follow a specific order of the channels while building the chain. The order of the channels from as given in
channel Unsecured channel channel secured by using SSL TCP channel X X SSL channel
X MQFAP channel X X For example, an SSL-based chain would consist of a TCP channel, SSL channel and MQFAP channel. When creating chains, the order of channels in the chain is important. Specify channels in the order in which they appear in the above table.
The example in this topic describes how to create an outbound chain capable of being used to contact WebSphere MQ queue manager receiver channels by using SSL-based encryption.
(iseries) Note: You open a wsadmin command session from within Qshell. For more information, see the topic "Configure Qshell to run WebSphere Application Server scripts".
- Locate the TransportChannelService object for the server in which to create the new chain. For example, in a WAS Network Deployment configuration, we can list the available TransportChannelService objects and select the appropriate service.
Jython:
wsadmin>AdminConfig.list("TransportChannelService" ) (cells/BadgerCell01/nodes/BadgerCellManager01/servers/dmgr|server.xml #TransportChannelService_1) (cells/BadgerCell01/nodes/BadgerNode01/servers/nodeagent|server.xml #TransportChannelService_1095 711814579) (cells/BadgerCell01/nodes/BadgerNode01/servers/server1|server.xml #TransportChannelService_109571 2023139) (cells/BadgerCell01/nodes/BadgerNode01/servers/server2|server.xml #TransportChannelService_109571 2039302) wsadmin>tcs = AdminConfig.list("TransportChannelService" ).split("\r\n")[2]Jacl:
wsadmin> $AdminConfig list TransportChannelService (cells/BadgerCell01/nodes/BadgerCellManager01/servers/dmgr|server.xml #TransportChannelService_1) (cells/BadgerCell01/nodes/BadgerNode01/servers/nodeagent|server.xml #TransportChannelService_1095711 814579) (cells/BadgerCell01/nodes/BadgerNode01/servers/server1|server.xml #TransportChannelService_109571202 3139) (cells/BadgerCell01/nodes/BadgerNode01/servers/server2|server.xml #TransportChannelService_109571203 9302) wsadmin> set tcs [lindex [$AdminConfig list TransportChannelService] 2] (cells/BadgerCell01/nodes/BadgerNode01/servers/server1|server.xml #TransportChannelService_109571202 3139)
- Define an outbound TCP channel called testTCPChannel.
Jython:
wsadmin>tcpChannel = AdminConfig.create("TCPOutboundChannel", tcs, [["name", "testTCPChannel"]] )
Jacl:
wsadmin>set tcpChannel [$AdminConfig create TCPOutboundChannel $tcs "{name testTCPChannel}"] testTCPChannel(cells/BadgerCell01/nodes/BadgerNode01/servers/server1|server.xml# TCPOutboundChannel_1095969213949)
- Define an outbound SSL channel called testSSLChannel. There are two steps required to define such a channel.
- Identify the SSL alias to be used by the channel.
Jython:
wsadmin>for obj in AdminConfig.list("SSLConfig" ).split("\r\n"): print obj+AdminConfig.show(obj, "alias")
Jacl:
wsadmin>foreach obj [$AdminConfig list SSLConfig] { puts "$obj [$AdminConfig show $obj alias]]" } (cells/BadgerCell01|security.xml#SSLConfig_1) {alias BadgerCellManager01/ DefaultSSLSettings}] (cells/BadgerCell01|security.xml#SSLConfig_1095711819776) {alias BadgerNode01/ DefaultSSLSettings}]
- Create an SSL channel as in the following example, in which the BadgerNode01/DefaultSSLSettings alias is used.
Using Jython:
wsadmin>sslChannel = AdminConfig.create("SSLOutboundChannel", tcs, [["name", "testSSLChannel"], ["sslConfigAlias","BadgerNode01/DefaultSSLSettings"]])
Jacl:
wsadmin>set sslChannel [$AdminConfig create SSLOutboundChannel $tcs "{name testSSLChannel} {sslConfigAlias BadgerNode01/DefaultSSLSettings}"] testSSLChannel(cells/BadgerCell01/nodes/BadgerNode01/servers/server1|server.xml# SSLOutboundChannel_1095971760671)
- Define an outbound MQFAP channel called testMQFAPChannel.
Jython:
wsadmin>mqfapChannel = AdminConfig.create("MQFAPOutboundChannel", tcs, [["name", "testMQFAPChannel"]] )
Jacl:
wsadmin>set mqfapChannel [$AdminConfig create MQFAPOutboundChannel $tcs "{name testMQFAPChannel}"] testMQFAPChannel(cells/BadgerCell01/nodes/BadgerNode01/servers/server1|server.xml# MQFAPOutboundChannel_1095977512682)
- Finally, create the channel chain by combining the channels defined so far. For example, to create a chain called testChain:
Jython:
wsadmin>AdminConfig.create("Chain", tcs, [["name", "testChain"], ["enable", "true"], ["transportChannels", [tcpChannel, sslChannel, mqfapChannel]]] )
Jacl:
wsadmin>$AdminConfig create Chain $tcs "{name testChain} {enable true} {transportChannels {$tcpChannel $sslChannel $mqfapChannel}}" testChain(cells/BadgerCell01/nodes/BadgerNode01/servers/server1|server.xml#Chain_109 5977640896)