How to view kafka message
is there any way I can view the message content sent to kafka for a given topic? Say some thing like view last 5 messages for this topic, if that it possible.
thanks,
Sandeep
apache-kafka
add a comment |
is there any way I can view the message content sent to kafka for a given topic? Say some thing like view last 5 messages for this topic, if that it possible.
thanks,
Sandeep
apache-kafka
add a comment |
is there any way I can view the message content sent to kafka for a given topic? Say some thing like view last 5 messages for this topic, if that it possible.
thanks,
Sandeep
apache-kafka
is there any way I can view the message content sent to kafka for a given topic? Say some thing like view last 5 messages for this topic, if that it possible.
thanks,
Sandeep
apache-kafka
apache-kafka
asked May 29 '17 at 9:28
SandySandy
3111516
3111516
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
You can use console consumer to view messages produced on some topic:
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning
This command also required --zookeeper details , I added those like - ./kafka-console-consumer.sh --zookeeper localhost:2181 --bootstrap-server localhost:9092 --topic test. But now I get - kafka.common.ConsumerRebalanceFailedException: console-consumer-18088_sp-1496052524018-50bb9338 can't rebalance after 4 retries at kafka.consumer.ZookeeperConsumerConnector$ZKRebalancerListener.syncedRebalance(ZookeeperConsumerConnector.scala:660) at
– Sandy
May 29 '17 at 10:11
Which is a separate issue. Take a look at this: stackoverflow.com/questions/22563401/…
– vatsal mevada
May 29 '17 at 10:15
2
Use bin/kafka-console-consumer.sh --new-consumer --bootstrap-server localhost:9092 --topic test --from-beginning
– Luciano Afranllie
May 29 '17 at 12:27
1
bootstrap-server
vs.zookeeper
is a matter of kafka version.
– Joe Atzberger
Sep 14 '17 at 23:07
add a comment |
Use the Kafka consumer provided by Kafka :
bin/kafka-console-consumer.sh --bootstrap-server BROKERS --topic TOPIC_NAME
It will display the messages as it will receive it. Add --from-beginning
if you want to start from the beginning.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f44239027%2fhow-to-view-kafka-message%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can use console consumer to view messages produced on some topic:
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning
This command also required --zookeeper details , I added those like - ./kafka-console-consumer.sh --zookeeper localhost:2181 --bootstrap-server localhost:9092 --topic test. But now I get - kafka.common.ConsumerRebalanceFailedException: console-consumer-18088_sp-1496052524018-50bb9338 can't rebalance after 4 retries at kafka.consumer.ZookeeperConsumerConnector$ZKRebalancerListener.syncedRebalance(ZookeeperConsumerConnector.scala:660) at
– Sandy
May 29 '17 at 10:11
Which is a separate issue. Take a look at this: stackoverflow.com/questions/22563401/…
– vatsal mevada
May 29 '17 at 10:15
2
Use bin/kafka-console-consumer.sh --new-consumer --bootstrap-server localhost:9092 --topic test --from-beginning
– Luciano Afranllie
May 29 '17 at 12:27
1
bootstrap-server
vs.zookeeper
is a matter of kafka version.
– Joe Atzberger
Sep 14 '17 at 23:07
add a comment |
You can use console consumer to view messages produced on some topic:
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning
This command also required --zookeeper details , I added those like - ./kafka-console-consumer.sh --zookeeper localhost:2181 --bootstrap-server localhost:9092 --topic test. But now I get - kafka.common.ConsumerRebalanceFailedException: console-consumer-18088_sp-1496052524018-50bb9338 can't rebalance after 4 retries at kafka.consumer.ZookeeperConsumerConnector$ZKRebalancerListener.syncedRebalance(ZookeeperConsumerConnector.scala:660) at
– Sandy
May 29 '17 at 10:11
Which is a separate issue. Take a look at this: stackoverflow.com/questions/22563401/…
– vatsal mevada
May 29 '17 at 10:15
2
Use bin/kafka-console-consumer.sh --new-consumer --bootstrap-server localhost:9092 --topic test --from-beginning
– Luciano Afranllie
May 29 '17 at 12:27
1
bootstrap-server
vs.zookeeper
is a matter of kafka version.
– Joe Atzberger
Sep 14 '17 at 23:07
add a comment |
You can use console consumer to view messages produced on some topic:
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning
You can use console consumer to view messages produced on some topic:
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning
edited Jan 25 at 20:12
Andrew Theken
2,54112349
2,54112349
answered May 29 '17 at 9:31
vatsal mevadavatsal mevada
1,52121839
1,52121839
This command also required --zookeeper details , I added those like - ./kafka-console-consumer.sh --zookeeper localhost:2181 --bootstrap-server localhost:9092 --topic test. But now I get - kafka.common.ConsumerRebalanceFailedException: console-consumer-18088_sp-1496052524018-50bb9338 can't rebalance after 4 retries at kafka.consumer.ZookeeperConsumerConnector$ZKRebalancerListener.syncedRebalance(ZookeeperConsumerConnector.scala:660) at
– Sandy
May 29 '17 at 10:11
Which is a separate issue. Take a look at this: stackoverflow.com/questions/22563401/…
– vatsal mevada
May 29 '17 at 10:15
2
Use bin/kafka-console-consumer.sh --new-consumer --bootstrap-server localhost:9092 --topic test --from-beginning
– Luciano Afranllie
May 29 '17 at 12:27
1
bootstrap-server
vs.zookeeper
is a matter of kafka version.
– Joe Atzberger
Sep 14 '17 at 23:07
add a comment |
This command also required --zookeeper details , I added those like - ./kafka-console-consumer.sh --zookeeper localhost:2181 --bootstrap-server localhost:9092 --topic test. But now I get - kafka.common.ConsumerRebalanceFailedException: console-consumer-18088_sp-1496052524018-50bb9338 can't rebalance after 4 retries at kafka.consumer.ZookeeperConsumerConnector$ZKRebalancerListener.syncedRebalance(ZookeeperConsumerConnector.scala:660) at
– Sandy
May 29 '17 at 10:11
Which is a separate issue. Take a look at this: stackoverflow.com/questions/22563401/…
– vatsal mevada
May 29 '17 at 10:15
2
Use bin/kafka-console-consumer.sh --new-consumer --bootstrap-server localhost:9092 --topic test --from-beginning
– Luciano Afranllie
May 29 '17 at 12:27
1
bootstrap-server
vs.zookeeper
is a matter of kafka version.
– Joe Atzberger
Sep 14 '17 at 23:07
This command also required --zookeeper details , I added those like - ./kafka-console-consumer.sh --zookeeper localhost:2181 --bootstrap-server localhost:9092 --topic test. But now I get - kafka.common.ConsumerRebalanceFailedException: console-consumer-18088_sp-1496052524018-50bb9338 can't rebalance after 4 retries at kafka.consumer.ZookeeperConsumerConnector$ZKRebalancerListener.syncedRebalance(ZookeeperConsumerConnector.scala:660) at
– Sandy
May 29 '17 at 10:11
This command also required --zookeeper details , I added those like - ./kafka-console-consumer.sh --zookeeper localhost:2181 --bootstrap-server localhost:9092 --topic test. But now I get - kafka.common.ConsumerRebalanceFailedException: console-consumer-18088_sp-1496052524018-50bb9338 can't rebalance after 4 retries at kafka.consumer.ZookeeperConsumerConnector$ZKRebalancerListener.syncedRebalance(ZookeeperConsumerConnector.scala:660) at
– Sandy
May 29 '17 at 10:11
Which is a separate issue. Take a look at this: stackoverflow.com/questions/22563401/…
– vatsal mevada
May 29 '17 at 10:15
Which is a separate issue. Take a look at this: stackoverflow.com/questions/22563401/…
– vatsal mevada
May 29 '17 at 10:15
2
2
Use bin/kafka-console-consumer.sh --new-consumer --bootstrap-server localhost:9092 --topic test --from-beginning
– Luciano Afranllie
May 29 '17 at 12:27
Use bin/kafka-console-consumer.sh --new-consumer --bootstrap-server localhost:9092 --topic test --from-beginning
– Luciano Afranllie
May 29 '17 at 12:27
1
1
bootstrap-server
vs. zookeeper
is a matter of kafka version.– Joe Atzberger
Sep 14 '17 at 23:07
bootstrap-server
vs. zookeeper
is a matter of kafka version.– Joe Atzberger
Sep 14 '17 at 23:07
add a comment |
Use the Kafka consumer provided by Kafka :
bin/kafka-console-consumer.sh --bootstrap-server BROKERS --topic TOPIC_NAME
It will display the messages as it will receive it. Add --from-beginning
if you want to start from the beginning.
add a comment |
Use the Kafka consumer provided by Kafka :
bin/kafka-console-consumer.sh --bootstrap-server BROKERS --topic TOPIC_NAME
It will display the messages as it will receive it. Add --from-beginning
if you want to start from the beginning.
add a comment |
Use the Kafka consumer provided by Kafka :
bin/kafka-console-consumer.sh --bootstrap-server BROKERS --topic TOPIC_NAME
It will display the messages as it will receive it. Add --from-beginning
if you want to start from the beginning.
Use the Kafka consumer provided by Kafka :
bin/kafka-console-consumer.sh --bootstrap-server BROKERS --topic TOPIC_NAME
It will display the messages as it will receive it. Add --from-beginning
if you want to start from the beginning.
answered May 29 '17 at 14:57
ImbaBalboaImbaBalboa
595318
595318
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f44239027%2fhow-to-view-kafka-message%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown