diff options
5 files changed, 12 insertions, 3 deletions
diff --git a/src/main/java/com/att/nsa/cambria/metrics/publisher/CambriaPublisherUtility.java b/src/main/java/com/att/nsa/cambria/metrics/publisher/CambriaPublisherUtility.java index 8e54ee5..511053e 100644 --- a/src/main/java/com/att/nsa/cambria/metrics/publisher/CambriaPublisherUtility.java +++ b/src/main/java/com/att/nsa/cambria/metrics/publisher/CambriaPublisherUtility.java @@ -53,7 +53,7 @@ public class CambriaPublisherUtility } catch ( UnsupportedEncodingException e ) { - throw new RuntimeException ( e ); + throw new AssertionError ( e ); } } /** diff --git a/src/main/java/com/att/nsa/cambria/resources/CambriaOutboundEventStream.java b/src/main/java/com/att/nsa/cambria/resources/CambriaOutboundEventStream.java index e519f71..7366dde 100644 --- a/src/main/java/com/att/nsa/cambria/resources/CambriaOutboundEventStream.java +++ b/src/main/java/com/att/nsa/cambria/resources/CambriaOutboundEventStream.java @@ -44,6 +44,8 @@ import com.att.nsa.cambria.metabroker.Topic; import com.att.nsa.cambria.utils.DMaaPResponseBuilder.StreamWriter; import com.att.nsa.cambria.utils.Utils; +import jline.internal.Log; + /** * class used to write the consumed messages @@ -327,7 +329,8 @@ public class CambriaOutboundEventStream implements StreamWriter { // FIXME: would be good to wait/signal Thread.sleep(100); } catch (InterruptedException e) { - // ignore + Log.error(e.toString()); + Thread.currentThread().interrupt(); } } }); diff --git a/src/main/java/com/att/nsa/cambria/resources/streamReaders/CambriaJsonStreamReader.java b/src/main/java/com/att/nsa/cambria/resources/streamReaders/CambriaJsonStreamReader.java index 54a9bc6..c8172a9 100644 --- a/src/main/java/com/att/nsa/cambria/resources/streamReaders/CambriaJsonStreamReader.java +++ b/src/main/java/com/att/nsa/cambria/resources/streamReaders/CambriaJsonStreamReader.java @@ -72,6 +72,7 @@ public class CambriaJsonStreamReader implements reader { throw new CambriaApiException(HttpServletResponse.SC_BAD_REQUEST, "Expecting an array or an object."); } } catch (JSONException e) { + Log.error(e); throw new CambriaApiException(HttpServletResponse.SC_BAD_REQUEST, e.getMessage()); } } diff --git a/src/main/java/com/att/nsa/cambria/resources/streamReaders/CambriaTextStreamReader.java b/src/main/java/com/att/nsa/cambria/resources/streamReaders/CambriaTextStreamReader.java index 2b76a61..41b9275 100644 --- a/src/main/java/com/att/nsa/cambria/resources/streamReaders/CambriaTextStreamReader.java +++ b/src/main/java/com/att/nsa/cambria/resources/streamReaders/CambriaTextStreamReader.java @@ -25,6 +25,7 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.util.logging.Logger; import javax.servlet.http.HttpServletResponse; @@ -33,6 +34,8 @@ import com.att.nsa.cambria.backends.Publisher.message; import com.att.nsa.cambria.beans.LogDetails; import com.att.nsa.cambria.resources.CambriaEventSet.reader; +import jline.internal.Log; + /** * This stream reader just pulls single lines. It uses the default partition if provided. If * not, the key is the current time, which does not guarantee ordering. @@ -42,6 +45,7 @@ import com.att.nsa.cambria.resources.CambriaEventSet.reader; */ public class CambriaTextStreamReader implements reader { + private Logger log = Logger.getLogger(CambriaTextStreamReader.class.toString()); /** * This is the constructor for Cambria Text Reader format * @param is @@ -131,6 +135,7 @@ public class CambriaTextStreamReader implements reader } catch ( IOException e ) { + Log.error(e); throw new CambriaApiException ( HttpServletResponse.SC_BAD_REQUEST, e.getMessage () ); } } diff --git a/src/main/java/com/att/nsa/cambria/service/impl/MMServiceImpl.java b/src/main/java/com/att/nsa/cambria/service/impl/MMServiceImpl.java index da024f1..04cc51c 100644 --- a/src/main/java/com/att/nsa/cambria/service/impl/MMServiceImpl.java +++ b/src/main/java/com/att/nsa/cambria/service/impl/MMServiceImpl.java @@ -223,7 +223,7 @@ public class MMServiceImpl implements MMService { metricsSet.consumeTick(sent); } catch (UnavailableException excp) { - + LOG.error(excp.toString()); ErrorResponse errRes = new ErrorResponse(HttpStatus.SC_SERVICE_UNAVAILABLE, DMaaPResponseCode.SERVER_UNAVAILABLE.getResponseCode(), errorMessages.getServerUnav() + excp.getMessage(), null, Utils.getFormattedDate(new Date()), topic, |