You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "LEONARDO ZANDOMENICO VASCONCELLOS (JIRA)" <ji...@apache.org> on 2019/08/09 05:23:00 UTC

[jira] [Updated] (CAMEL-13842) Improve Logging on KafkaConsumer when KafkaException is Thrown

     [ https://issues.apache.org/jira/browse/CAMEL-13842?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

LEONARDO ZANDOMENICO VASCONCELLOS updated CAMEL-13842:
------------------------------------------------------
    Description: 
The Kafka Camel component "hides" the stacktrace of exceptions occurring in the following point. 
{code:java}
components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java{code}
{code:java}
...
} catch (KafkaException e) {
	// some kind of error in kafka, it may happen during
	// unsubscribing or during normal processing
	if (unsubscribing) {
	    getExceptionHandler().handleException("Error unsubscribing " + threadId + " from kafka topic " + topicName, e);
	} else {
	    log.warn("KafkaException consuming {} from topic {}. Will attempt to re-connect on next run", threadId, topicName);
	    reConnect = true;
	}
}
...{code}
It makes difficult to know the root of the KafkaException exception (NullPointer for example) by seeing the log.

Maybe change the log.warn to handtleException so we can see the full stack trace in the log:
{code:java}
getExceptionHandler().handleException("KafkaException consuming " + threadId + " from topic " + topicName + ". Will attempt to re-connect on next run", e);
{code}
 

  was:
The Kafka Camel component "hides" the stacktrace of exceptions occurring in the following point. 
{code:java}
components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java{code}
{code:java}
...
} catch (KafkaException e) {
	// some kind of error in kafka, it may happen during
	// unsubscribing or during normal processing
	if (unsubscribing) {
	getExceptionHandler().handleException("Error unsubscribing " + threadId + " from kafka topic " + topicName, e);
	} else {
	log.warn("KafkaException consuming {} from topic {}. Will attempt to re-connect on next run", threadId, topicName);
	reConnect = true;
	}
	}
...{code}
It makes difficult to know the root of the KafkaException exception (NullPointer for example) by seeing the log.

Maybe change the log.warn to handtleException so we can see the full stack trace in the log:
{code:java}
getExceptionHandler().handleException("KafkaException consuming " + threadId + " from topic " + topicName + ". Will attempt to re-connect on next run", e);
{code}
 


> Improve Logging on KafkaConsumer when KafkaException is Thrown
> --------------------------------------------------------------
>
>                 Key: CAMEL-13842
>                 URL: https://issues.apache.org/jira/browse/CAMEL-13842
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-kafka
>    Affects Versions: 3.0.0
>            Reporter: LEONARDO ZANDOMENICO VASCONCELLOS
>            Priority: Major
>
> The Kafka Camel component "hides" the stacktrace of exceptions occurring in the following point. 
> {code:java}
> components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java{code}
> {code:java}
> ...
> } catch (KafkaException e) {
> 	// some kind of error in kafka, it may happen during
> 	// unsubscribing or during normal processing
> 	if (unsubscribing) {
> 	    getExceptionHandler().handleException("Error unsubscribing " + threadId + " from kafka topic " + topicName, e);
> 	} else {
> 	    log.warn("KafkaException consuming {} from topic {}. Will attempt to re-connect on next run", threadId, topicName);
> 	    reConnect = true;
> 	}
> }
> ...{code}
> It makes difficult to know the root of the KafkaException exception (NullPointer for example) by seeing the log.
> Maybe change the log.warn to handtleException so we can see the full stack trace in the log:
> {code:java}
> getExceptionHandler().handleException("KafkaException consuming " + threadId + " from topic " + topicName + ". Will attempt to re-connect on next run", e);
> {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)