You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/06/14 07:37:38 UTC

[GitHub] [camel] davsclaus commented on a change in pull request #5657: camel-zipkin - ZipkinServerResponseAdapter NPE fix

davsclaus commented on a change in pull request #5657:
URL: https://github.com/apache/camel/pull/5657#discussion_r650079492



##########
File path: components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinServerResponseAdapter.java
##########
@@ -45,7 +45,7 @@ void onResponse(Exchange exchange, SpanCustomizer span) {
         span.tag("camel.server.exchange.id", id);
         span.tag("camel.server.exchange.pattern", mep);
 
-        if (exchange.getException() != null) {
+        if (exchange.getException() != null && exchange.getException().getMessage() != null) {

Review comment:
       There is still a failure, so you should instead if the message is null, create a empty message, or use the exception classname as the message.

##########
File path: components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinServerResponseAdapter.java
##########
@@ -45,7 +45,7 @@ void onResponse(Exchange exchange, SpanCustomizer span) {
         span.tag("camel.server.exchange.id", id);
         span.tag("camel.server.exchange.pattern", mep);
 
-        if (exchange.getException() != null) {
+        if (exchange.getException() != null && exchange.getException().getMessage() != null) {

Review comment:
       Yes correct, then we always ensure that if an exception occurred then zipkin gets that as a failure event

##########
File path: components/camel-zipkin/pom.xml
##########
@@ -45,6 +45,12 @@
             <artifactId>camel-support</artifactId>
         </dependency>
 
+        <dependency>

Review comment:
       Please do not add a new dependency just for checking if a string is empty/black.
   
   You can use Camel's own 
   
   org/apache/camel/util/ObjectHelper.isEmpty




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org