@@ -116,9 +116,13 @@ private void updateMetricsWithWildcards(PCFMessage[] pcfResponse) {
116
116
updateMetricWithoutWildcards (directPCFResponse [0 ], objectName );
117
117
} catch (PCFException e ) {
118
118
//This error means, that channel has status "inactive".
119
- logger .warn ("Channel {} is possibly inactive." , objectName );
120
- if (e .reasonCode == MQConstants .MQRCCF_CHL_STATUS_NOT_FOUND ) {
119
+ if (object .getType () == MQObject .MQType .CHANNEL && e .reasonCode == MQConstants .MQRCCF_CHL_STATUS_NOT_FOUND ) {
121
120
MetricsManager .updateMetric (MetricsReference .getMetricName (object .getType ()), MetricsReference .getMetricValue (object .getType (), MQConstants .MQCHS_INACTIVE ), queueManagerName , objectName );
121
+ logger .warn ("Channel {} is possibly inactive." , objectName );
122
+ }
123
+ if (object .getType () == MQObject .MQType .LISTENER && e .reasonCode == MQConstants .MQRC_UNKNOWN_OBJECT_NAME ) {
124
+ MetricsManager .updateMetric (MetricsReference .getMetricName (object .getType ()), MetricsReference .getMetricValue (object .getType (), MQConstants .MQSVC_STATUS_STOPPED ), queueManagerName , objectName );
125
+ logger .warn ("Listener {} is possibly stopped." , objectName );
122
126
}
123
127
} catch (IOException | MQException e ) {
124
128
logger .error ("Error occurred during sending PCF command: " , e );
@@ -145,6 +149,10 @@ public void run() {
145
149
logger .warn ("Channel {} is possibly inactive." , object .getName ());
146
150
MetricsManager .updateMetric (MetricsReference .getMetricName (object .getType ()), MetricsReference .getMetricValue (object .getType (), MQConstants .MQCHS_INACTIVE ), queueManagerName , object .getName ());
147
151
}
152
+ if (object .getType () == MQObject .MQType .LISTENER && e .reasonCode == MQConstants .MQRC_UNKNOWN_OBJECT_NAME ) {
153
+ MetricsManager .updateMetric (MetricsReference .getMetricName (object .getType ()), MetricsReference .getMetricValue (object .getType (), MQConstants .MQSVC_STATUS_STOPPED ), queueManagerName , object .getName ());
154
+ logger .warn ("Listener {} is possibly stopped." , object .getName ());
155
+ }
148
156
} catch (MQException | IOException e ) {
149
157
logger .error ("Error occurred during sending PCF command: " , e );
150
158
}
0 commit comments