You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Keith Bloomfield (JIRA)" <ji...@apache.org> on 2015/02/19 22:28:11 UTC

[jira] [Updated] (KAFKA-1968) SimpleConsumer succeeds with embedded failure message

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

Keith Bloomfield updated KAFKA-1968:
------------------------------------
    Description: 
I am using a modified version of the Kafka SimpleConsumer to expose offsets to a rest api, based on: https://cwiki.apache.org/confluence/display/KAFKA/0.8.0+SimpleConsumer+Example

However, the behavior of the example is inconsistent with the shell command: ./kafka-run-class.sh kafka.tools.ConsumerOffsetChecker ...

In that sometimes it works, and sometimes it returns successfully with an embedded error. In other words, the check:

if (response.hasError()) {...}

passes because the response (as far as it's aware) has no error. But if I drop in a:

response.toString().contains("error")

then sure enough, there is an error in the response. The error is:

kafka.common.UnknownException

Not sure what is happening in Kafka to result in this behavior.

  was:
I am using a modified version of the Kafka SimpleConsumer to expose offsets to a rest api, based on: https://cwiki.apache.org/confluence/display/KAFKA/0.8.0+SimpleConsumer+Example

However, the behavior of the example is inconsistent with the shell command: ./kafka-run-class.sh kafka.tools.ConsumerOffsetChecker ...

In that sometimes it works, and sometimes it returns successfully with an embedded error. In other words, the check:

if (response.hasError()) {...}

is entirely useless because the response (as far as it's aware) has no error. But if I drop in a:

response.toString().contains("error")

then sure enough, there is an error in the response. The error is:

kafka.common.UnknownException

Not sure what is happening in Kafka to result in this behavior.


> SimpleConsumer succeeds with embedded failure message
> -----------------------------------------------------
>
>                 Key: KAFKA-1968
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1968
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients
>    Affects Versions: 0.8.1.1
>         Environment: javaapi on Java 6
>            Reporter: Keith Bloomfield
>
> I am using a modified version of the Kafka SimpleConsumer to expose offsets to a rest api, based on: https://cwiki.apache.org/confluence/display/KAFKA/0.8.0+SimpleConsumer+Example
> However, the behavior of the example is inconsistent with the shell command: ./kafka-run-class.sh kafka.tools.ConsumerOffsetChecker ...
> In that sometimes it works, and sometimes it returns successfully with an embedded error. In other words, the check:
> if (response.hasError()) {...}
> passes because the response (as far as it's aware) has no error. But if I drop in a:
> response.toString().contains("error")
> then sure enough, there is an error in the response. The error is:
> kafka.common.UnknownException
> Not sure what is happening in Kafka to result in this behavior.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)