GithubHelp home page GithubHelp logo

sample-spring-kafka-producer-consumer's Introduction

Getting Started

These instructions will show how to run kafka locally and how to install kafkacat, a tool to display messages in a kafka topic

Run kafka locally

In a terminal cd to the root of this project and run

docker-compose up -d

Check both kafka and zookeeper are running

docker ps

Install kafkacat

Install kafkacat utility using the local package manager.

sudo apt-get install kafkacat

Start up the Producer, from the root of the project

cd sample-spring-kafka-producer
../gradlew bootRun

Start up the Consumer

cd sample-spring-kafka-consumer
../gradlew bootRun

At this point some sample messages can be generated using this endpoint:

The producer should print a message on the console that the Work unit has been dispatched and the consumer should receive and process the Work unit

sample-spring-kafka-producer-consumer's People

Contributors

bijukunjummen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sample-spring-kafka-producer-consumer's Issues

EmbedKafkaTest.testEmbeddedRawKafka() doesn't work

Hello!

Thank you for the sample code.

I am trying to use Spring KafkaEmbedded for my Junit test. I tried the test case EmbedKafkaTest.testEmbeddedRawKafka() but it doesn't work. It seems that the producer can't send the message. I got the following exception,

ERROR com.oracle.oal.event.notification.query.eventcollecting.controller.advice.ControllersAdvice - Error in event controller org.apache.kafka.common.errors.UnknownServerException: The server experienced an unexpected error when processing the request
java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.UnknownServerException: The server experienced an unexpected error when processing the request
	at org.apache.kafka.clients.producer.internals.FutureRecordMetadata.valueOrError(FutureRecordMetadata.java:70) ~[kafka-clients-0.10.2.1.jar:?]
	at org.apache.kafka.clients.producer.internals.FutureRecordMetadata.get(FutureRecordMetadata.java:57) ~[kafka-clients-0.10.2.1.jar:?]
	at org.apache.kafka.clients.producer.internals.FutureRecordMetadata.get(FutureRecordMetadata.java:25) ~[kafka-clients-0.10.2.1.jar:?]
	at 

Could you help?

Best regards.
Heidi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.