@@ -751,15 +751,15 @@ func discoverQueues(monitoredQueuePatterns string) error {
751751 var ok bool
752752 qName := strings .TrimSpace (qList [i ])
753753
754- // If the qName contains a '/' - eg "DEV/QUEUE/1" then the queue manager will
755- // not (right now) process resource publications correctly. Hopefully that will get
756- // fixed at some point, but we will issue a warning here. The same problem happens with
757- // amqsrua; there's no workround possible outside of the qmgr code .
754+ // If the qName contains a '/' - eg "DEV/QUEUE/1" then the queue manager cannot
755+ // process resource publications by simply inserting the qName because it disrupts
756+ // the topic string pattern. This was fixed in the queue manager by 9.3.0 by allowing
757+ // the subscriptions to use '&' in place of the '/' character .
758758 //
759- // Because of the possible complexities of pattern matching, we don't
759+ // For older levels of MQ, because of the possible complexities of pattern matching, we don't
760760 // actually fail the discovery process, but instead issue a warning and continue with
761761 // other queues.
762- if strings .Contains (qName , "/" ) && ci .globalSlashWarning == false {
762+ if strings .Contains (qName , "/" ) && ci .globalSlashWarning == false && GetCommandLevel () < ibmmq . MQCMDL_LEVEL_930 {
763763 ci .localSlashWarning = true // First time through, issue the warning for all queues
764764 logError ("Warning: Cannot subscribe to queue containing '/': %s" , qName )
765765 continue
@@ -1038,7 +1038,15 @@ func createSubscriptions() error {
10381038 delete (ty .subHobj , key )
10391039 }
10401040 } else {
1041- topic := fmt .Sprintf (ty .ObjectTopic , key )
1041+ // Convert embedded "/" to "&" in the topic subscriptions, provided
1042+ // we are at MQ 9.3. The maps referring to the topic still keep the "/" in
1043+ // the key for maps referring to the object; we don't need the modified topic name
1044+ // outside of the initial subscription.
1045+ keyDeslashed := key
1046+ if GetCommandLevel () >= ibmmq .MQCMDL_LEVEL_930 {
1047+ keyDeslashed = strings .Replace (key , "/" , "&" , - 1 )
1048+ }
1049+ topic := fmt .Sprintf (ty .ObjectTopic , keyDeslashed )
10421050 if usingDurableSubs {
10431051 mqtd , err = subscribeDurable (topic , & ci .si .replyQObj )
10441052 } else {
0 commit comments