{"id":21581558,"url":"https://github.com/thoughtscript/kafka_spring_docker_2024","last_synced_at":"2026-05-22T05:10:18.636Z","repository":{"id":238040188,"uuid":"795616450","full_name":"Thoughtscript/kafka_spring_docker_2024","owner":"Thoughtscript","description":"Experiments with Kafka and Java Webflux","archived":false,"fork":false,"pushed_at":"2024-12-29T22:29:51.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-24T14:45:05.650Z","etag":null,"topics":["docker-compose","java","kafka","pubsub","webflux"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Thoughtscript.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-03T16:55:54.000Z","updated_at":"2024-12-29T22:29:55.000Z","dependencies_parsed_at":"2024-05-04T01:24:38.493Z","dependency_job_id":"a7f4d649-e3d7-473b-8a6d-db6b31c5fcdd","html_url":"https://github.com/Thoughtscript/kafka_spring_docker_2024","commit_stats":null,"previous_names":["thoughtscript/spring_docker_2024","thoughtscript/kafka_spring_docker_2024"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thoughtscript%2Fkafka_spring_docker_2024","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thoughtscript%2Fkafka_spring_docker_2024/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thoughtscript%2Fkafka_spring_docker_2024/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thoughtscript%2Fkafka_spring_docker_2024/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Thoughtscript","download_url":"https://codeload.github.com/Thoughtscript/kafka_spring_docker_2024/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244181391,"owners_count":20411605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-compose","java","kafka","pubsub","webflux"],"created_at":"2024-11-24T14:12:55.068Z","updated_at":"2026-05-22T05:10:18.577Z","avatar_url":"https://github.com/Thoughtscript.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kafka_spring_docker_2024\n\n[![](https://img.shields.io/badge/bitnami-kafka-red.svg)](https://hub.docker.com/r/bitnami/kafka) [![](https://img.shields.io/badge/Java-22-blue.svg)](https://hub.docker.com/_/maven) [![](https://img.shields.io/badge/Spring-Webflux-green.svg)](https://docs.spring.io/spring-framework/reference/web/webflux.html)\n\nRun the following from the root dir:\n\n```bash\ndocker-compose up\n\n# If using Docker Compose Engine V2:\ndocker compose up\n```\n\nUpon running that command you should see:\n\n```bash\nconsumer_1  | 2024-05-03T23:57:07.747Z  INFO 60 --- [or-http-epoll-2] i.t.s.c.ReactiveRestController           : webclient message\nproducer_1  | 2024-05-03T23:57:07.749Z  INFO 60 --- [or-http-epoll-3] i.t.publisher.webclient.WebClient        : WebClient message sent!\nproducer_1  | 2024-05-03T23:57:12.335Z  INFO 60 --- [pool-5-thread-1] i.t.p.kafka.EmbeddedComponentClient      : Kafka message sent!\nconsumer_1  | 2024-05-03T23:57:12.338Z  INFO 60 --- [ntainer#0-0-C-1] i.t.s.kafka.EmbeddedComponentReceiver    : hello1\nconsumer_1  | 2024-05-03T23:57:12.338Z  INFO 60 --- [ntainer#0-0-C-1] i.t.s.kafka.EmbeddedComponentReceiver    : hello2\nconsumer_1  | 2024-05-03T23:57:12.338Z  INFO 60 --- [ntainer#0-0-C-1] i.t.s.kafka.EmbeddedComponentReceiver    : hello3\nconsumer_1  | 2024-05-03T23:57:12.339Z  INFO 60 --- [ntainer#0-0-C-1] i.t.s.kafka.EmbeddedComponentReceiver    : hello4\nconsumer_1  | 2024-05-03T23:57:12.752Z  INFO 60 --- [or-http-epoll-2] i.t.s.c.ReactiveRestController           : webclient message\nproducer_1  | 2024-05-03T23:57:12.753Z  INFO 60 --- [or-http-epoll-3] i.t.publisher.webclient.WebClient        : WebClient message sent!\n```\n\nThe **Producer** app will repeatedly loop through and send a bunch of HTTP Webflux and Kafka messages to the `test` topic. The **Consumer** app will consume both kinds of messages using the simply wonderful (concise) `EmbeddedComponentClient` approach (great functionalitiy provided by the Spring Kafka libraries) and a `ReactiveRestController`!\n\n\u003e Note: the whole cluster may take a few seconds to stabilize on app initialization, eventually you should just see a loop of messages like hte above.\n\n## Kafka Notes\n\nTrying out:\n\n1. Kafka without Zookeeper! Using KRraft.\n2. Addressing [Scenario 5](https://www.confluent.io/blog/kafka-client-cannot-connect-to-broker-on-aws-on-docker-etc/#scenario-5) without doing the recommended ways (great article and super helpful - not sure exactly what's changed since 2020 but I got this working with two changes: `networks` in [docker-compose.yml](docker-compose.yml) and `spring.kafka.bootstrap-servers` using the Docker-managed DNS `kafka:9092` in [application.properties](src/main/resources/application.properties)).\n3. Containerizing, simplifying, and updating my 2022 examples from: [java-reactive-pubsub\n](https://github.com/Thoughtscript/java-reactive-pubsub).\n4. Also, curious about different ways to containerize Java Spring Boot apps - oftentimes people containerize just the `.jar` - is it easier to just supply the exploded file source code?\n\n\n## Resources and Links\n\n1. https://www.confluent.io/blog/kafka-client-cannot-connect-to-broker-on-aws-on-docker-etc/#scenario-5\n2. https://www.baeldung.com/java-kafka-bootstrap-server\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoughtscript%2Fkafka_spring_docker_2024","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthoughtscript%2Fkafka_spring_docker_2024","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoughtscript%2Fkafka_spring_docker_2024/lists"}