I'm connecting to an IBM MQSeries server using the Perl MQClient::MQSeries module on a MQSeries 9 client and server installation on a CentOS 7 system.
I connect to the queue manager from two threads using
sub connectToQueuemanager
{
my ($host, $queuemanager, $channel) = @_;
my $coption = {
'ChannelName' => $channel,
'TransportType' => 'TCP',
'ConnectionName' => $host
};
my $compcode = 0;
my $compres = 0;
my $hconn = MQCONNX ($queuemanager, {'ClientConn' => $coption}, $compcode, $compres);
}
This works fine in the first thread, but not in the second - there I get code 2002 ("Application already connected.") as result. This problem did not appear with MQSeries version 6.
As of https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q025940_.htm this could be solved by setting MQCNO_HANDLE_SHARE_NO_BLOCK in the connection options. The Perl module MQSeries.pm lists this as one of the known constants, but I found no way to set this in the MQCONNX connection call.
How can I set this option in the MQCONNX call?