@@ -97,6 +97,10 @@ const defaultMaxQDepth = 5000
9797// Metrics is the global variable for the tree of data
9898var Metrics AllMetrics
9999
100+ // Only issue the warning about a '/' in queue name once.
101+ var globalSlashWarning = false ;
102+ var localSlashWarning = false ;
103+
100104var qInfoMap map [string ]* QInfo
101105var locale string
102106var discoveryDone = false
@@ -550,12 +554,28 @@ func discoverQueues(monitoredQueuePatterns string) error {
550554 qList , err = inquireObjects (monitoredQueuePatterns , ibmmq .MQOT_Q )
551555 }
552556
557+ localSlashWarning = false
553558 if len (qList ) > 0 {
554559 //fmt.Printf("Monitoring Queues: %v\n", qList)
555560 for i := 0 ; i < len (qList ); i ++ {
556561 var qInfoElem * QInfo
557562 var ok bool
558563 qName := strings .TrimSpace (qList [i ])
564+
565+ // If the qName contains a '/' - eg "DEV/QUEUE/1" then the queue manager will
566+ // not (right now) process resource publications correctly. Hopefully that will get
567+ // fixed at some point, but we will issue a warning here. The same problem happens with
568+ // amqsrua; there's no workround possible outside of the qmgr code.
569+ //
570+ // Because of the possible complexities of pattern matching, we don't
571+ // actually fail the discovery process, but instead issue a warning and continue with
572+ // other queues.
573+ if strings .Contains (qName ,"/" ) && globalSlashWarning == false {
574+ localSlashWarning = true // First time through, issue the warning for all queues
575+ logError ("Warning: Cannot subscribe to queue containing '/': %s" ,qName )
576+ continue
577+ }
578+
559579 if qInfoElem , ok = qInfoMap [qName ]; ! ok {
560580 qInfoElem = new (QInfo )
561581 }
@@ -576,11 +596,16 @@ func discoverQueues(monitoredQueuePatterns string) error {
576596 }
577597 }
578598
599+ if localSlashWarning {
600+ globalSlashWarning = true
601+ }
602+
579603 if err != nil {
580604 //fmt.Printf("Queue Discovery Error: %v\n", err)
581605 }
582606 return nil
583607 }
608+
584609 return err
585610}
586611
@@ -722,7 +747,10 @@ func inquireObjects(objectPatternsList string, objectType int32) ([]string, erro
722747 missingPatterns = missingPatterns + " " + pattern
723748 }
724749 for i := 0 ; i < len (elem .String ); i ++ {
725- objectList = append (objectList , strings .TrimSpace (elem .String [i ]))
750+ s := strings .TrimSpace (elem .String [i ])
751+
752+ objectList = append (objectList , s )
753+
726754 }
727755 }
728756 }
0 commit comments