@@ -97,6 +97,10 @@ const defaultMaxQDepth = 5000
97
97
// Metrics is the global variable for the tree of data
98
98
var Metrics AllMetrics
99
99
100
+ // Only issue the warning about a '/' in queue name once.
101
+ var globalSlashWarning = false ;
102
+ var localSlashWarning = false ;
103
+
100
104
var qInfoMap map [string ]* QInfo
101
105
var locale string
102
106
var discoveryDone = false
@@ -550,12 +554,28 @@ func discoverQueues(monitoredQueuePatterns string) error {
550
554
qList , err = inquireObjects (monitoredQueuePatterns , ibmmq .MQOT_Q )
551
555
}
552
556
557
+ localSlashWarning = false
553
558
if len (qList ) > 0 {
554
559
//fmt.Printf("Monitoring Queues: %v\n", qList)
555
560
for i := 0 ; i < len (qList ); i ++ {
556
561
var qInfoElem * QInfo
557
562
var ok bool
558
563
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
+
559
579
if qInfoElem , ok = qInfoMap [qName ]; ! ok {
560
580
qInfoElem = new (QInfo )
561
581
}
@@ -576,11 +596,16 @@ func discoverQueues(monitoredQueuePatterns string) error {
576
596
}
577
597
}
578
598
599
+ if localSlashWarning {
600
+ globalSlashWarning = true
601
+ }
602
+
579
603
if err != nil {
580
604
//fmt.Printf("Queue Discovery Error: %v\n", err)
581
605
}
582
606
return nil
583
607
}
608
+
584
609
return err
585
610
}
586
611
@@ -722,7 +747,10 @@ func inquireObjects(objectPatternsList string, objectType int32) ([]string, erro
722
747
missingPatterns = missingPatterns + " " + pattern
723
748
}
724
749
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
+
726
754
}
727
755
}
728
756
}
0 commit comments