aboutsummaryrefslogtreecommitdiffstats
path: root/policy-endpoints/src
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-04-09 08:34:45 -0400
committerJim Hahn <jrh3@att.com>2019-04-09 08:36:36 -0400
commitf5586edf6bb68016b4259829b57ca7e3528b126a (patch)
tree972d2f746ff4890451f7d7613051567f910b51fb /policy-endpoints/src
parent7825f3af14dfb087c9039c17be100ee7214ed560 (diff)
Add more logging to message dispatcher
Change-Id: I889cb9397b4b834ab273ec8f8ddc1af2b3c3c05e Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'policy-endpoints/src')
-rw-r--r--policy-endpoints/src/main/java/org/onap/policy/common/endpoints/listeners/RequestIdDispatcher.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/listeners/RequestIdDispatcher.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/listeners/RequestIdDispatcher.java
index 9ba73c9b..fcf9c9a9 100644
--- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/listeners/RequestIdDispatcher.java
+++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/listeners/RequestIdDispatcher.java
@@ -116,13 +116,17 @@ public class RequestIdDispatcher<T> extends ScoListener<T> {
// dispatch the message
if (Strings.isNullOrEmpty(reqid)) {
// it's an autonomous message - offer it to all autonomous listeners
+ if (listeners.isEmpty()) {
+ logger.info("no listeners for autonomous message of type {}", message.getClass().getSimpleName());
+ }
+
for (TypedMessageListener<T> listener : listeners) {
- offerToListener(infra, topic, message, listener);
+ offerToListener(infra, topic, message, reqid, listener);
}
} else {
// it's a response to a particular request
- offerToListener(infra, topic, message, req2listener.get(reqid));
+ offerToListener(infra, topic, message, reqid, req2listener.get(reqid));
}
}
@@ -132,11 +136,14 @@ public class RequestIdDispatcher<T> extends ScoListener<T> {
* @param infra infrastructure on which the message was received
* @param topic topic on which the message was received
* @param msg message that was received
+ * @param reqid request id extracted from the message
* @param listener listener to which the message should be offered, or {@code null}
*/
- private void offerToListener(CommInfrastructure infra, String topic, T msg, TypedMessageListener<T> listener) {
+ private void offerToListener(CommInfrastructure infra, String topic, T msg, String reqid,
+ TypedMessageListener<T> listener) {
if (listener == null) {
+ logger.info("no listener for request id {}", reqid);
return;
}