From f28f6a7ac1329631454ff9f0f4f4c5b2d5fbdad7 Mon Sep 17 00:00:00 2001 From: Matt Roberts <32040584+matrober-uk@users.noreply.github.com> Date: Mon, 21 Oct 2024 11:40:52 -0700 Subject: [PATCH] Allow warning to be returned at same time as conn - #72 --- mqjms/ConnectionFactoryImpl.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mqjms/ConnectionFactoryImpl.go b/mqjms/ConnectionFactoryImpl.go index 1081c43..ad2e154 100644 --- a/mqjms/ConnectionFactoryImpl.go +++ b/mqjms/ConnectionFactoryImpl.go @@ -144,7 +144,7 @@ func (cf ConnectionFactoryImpl) CreateContextWithSessionMode(sessionMode int, mq // queue manager. qMgr, err := ibmmq.Connx(cf.QMName, cno) - if err == nil { + if (qMgr != ibmmq.MQQueueManager{}) { // Initialize the countInc value to 1 so that if CheckCount is enabled (>0) // then an error check will be made after the first message - to catch any @@ -163,7 +163,9 @@ func (cf ConnectionFactoryImpl) CreateContextWithSessionMode(sessionMode int, mq sendCheckCountInc: countInc, } - } else { + } + + if err != nil { // The underlying MQI call returned an error, so extract the relevant // details and pass it back to the caller as a JMSException