@@ -751,15 +751,15 @@ func discoverQueues(monitoredQueuePatterns string) error {
751
751
var ok bool
752
752
qName := strings .TrimSpace (qList [i ])
753
753
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 .
758
758
//
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
760
760
// actually fail the discovery process, but instead issue a warning and continue with
761
761
// other queues.
762
- if strings .Contains (qName , "/" ) && ci .globalSlashWarning == false {
762
+ if strings .Contains (qName , "/" ) && ci .globalSlashWarning == false && GetCommandLevel () < ibmmq . MQCMDL_LEVEL_930 {
763
763
ci .localSlashWarning = true // First time through, issue the warning for all queues
764
764
logError ("Warning: Cannot subscribe to queue containing '/': %s" , qName )
765
765
continue
@@ -1038,7 +1038,15 @@ func createSubscriptions() error {
1038
1038
delete (ty .subHobj , key )
1039
1039
}
1040
1040
} 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 )
1042
1050
if usingDurableSubs {
1043
1051
mqtd , err = subscribeDurable (topic , & ci .si .replyQObj )
1044
1052
} else {
0 commit comments