diff options
author | Balaji, Ramya (rb111y) <rb111y@att.com> | 2018-11-07 21:52:36 -0500 |
---|---|---|
committer | Balaji, Ramya (rb111y) <rb111y@att.com> | 2018-11-07 22:03:08 -0500 |
commit | 2d1632f1c930b02f567b4650cc7f27a40f1dfe1b (patch) | |
tree | 3fe2cb9df7122866687e3c8c2a7716dc4beb7947 /appc-adapters | |
parent | af2fcc24fc53bf8bde0e38f2276d702d923c4b80 (diff) |
More logging added to debug
Issue-ID: APPC-1231
Change-Id: I45790aff545c566fbf62ea1908143b15f3920122
Signed-off-by: Balaji, Ramya (rb111y) <rb111y@att.com>
Diffstat (limited to 'appc-adapters')
2 files changed, 10 insertions, 1 deletions
diff --git a/appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/http/HttpDmaapProducerImpl.java b/appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/http/HttpDmaapProducerImpl.java index ca3420a2c..3a986c31e 100644 --- a/appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/http/HttpDmaapProducerImpl.java +++ b/appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/http/HttpDmaapProducerImpl.java @@ -68,12 +68,14 @@ public class HttpDmaapProducerImpl extends CommonHttpClient implements Producer @Override public boolean post(String partition, String data) { + LOG.debug("Entering HttpDmaapProducerImpl::: post "); long sent = 0; try { HttpPost request = postReq(null); request.setHeader("Content-Type", CONTENT_TYPE); request.setEntity(new StringEntity(bodyLine(partition, data))); + LOG.debug("Before sendRequest HttpDmaapProducerImpl::: post "); sent = topics.stream() .filter(topic -> sendRequest(request, topic)) .count(); @@ -84,6 +86,7 @@ public class HttpDmaapProducerImpl extends CommonHttpClient implements Producer data, buildEx.getMessage()), buildEx); } + LOG.debug("Exiting HttpDmaapProducerImpl::: post "); return sent == topics.size(); } @@ -92,10 +95,15 @@ public class HttpDmaapProducerImpl extends CommonHttpClient implements Producer String uriStr = String.format(URL_TEMPLATE, hosts.get(0), topic); try { request.setURI(new URI(uriStr)); + LOG.debug("HttpDmaapProducerImpl::: before sendRequest()"); CloseableHttpResponse response = getClient().execute(request); + LOG.debug("HttpDmaapProducerImpl::: after sendRequest()"); if (response.getStatusLine().getStatusCode() == 200) { successful = true; } + else { + LOG.debug("HttpDmaapProducerImpl::: did not receive 200 for sendRequest"); + } response.close(); } catch (Exception sendEx) { LOG.error(String.format("Failed to send message to %s. Reason: %s", uriStr, sendEx.getMessage()), diff --git a/appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/impl/DmaapProducerImpl.java b/appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/impl/DmaapProducerImpl.java index b9a760596..e86ca97c1 100644 --- a/appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/impl/DmaapProducerImpl.java +++ b/appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/impl/DmaapProducerImpl.java @@ -139,6 +139,7 @@ public class DmaapProducerImpl implements Producer { @Override public boolean post(String partition, String data) { + LOG.debug("In DmaapProducerImpl.post()"); boolean success = true; Properties properties = configuration.getProperties(); if (properties != null && properties.getProperty("metric.enabled") != null) { @@ -154,7 +155,7 @@ public class DmaapProducerImpl implements Producer { LOG.info("Getting CambriaBatchingPublisher Clients ..."); clients = getClients(); } - + LOG.debug("In DmaapProducerImpl.post()::: before sending to clients"); for (MRBatchingPublisher client : clients) { try { LOG.debug(String.format("Posting %s to %s", data, client)); |