Skip to content

POC about uses of Akka Stream with Camel (rabbitmq) and Kafka with backpressure

Notifications You must be signed in to change notification settings

5u5iu5/akkaStreamCamelPocWithBackpressure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Akka Streams handle backpressure from Kafka and Rabbitmq

The main scala class is src\main\scala\poc\akkastream\main\LaunchStream.scala

Up Rabbit instance from Docker

 docker pull rabbitmq:latest
docker run -d --hostname my-rabbit --name some-rabbit -p 8080:15672 -p 8081:5672 rabbitmq

to enable management console from localhost:8080

docker exec some-rabbit rabbitmq-plugins enable rabbitmq_management
  • Create exchange with name consumerExchange with type direct
  • Binding with exchange a new queue with name cola1

Up Kafka instance from Docker

Go to docker dir where is docker-compose-yml and run docker compose command

 docker-compose up

When docker container is running you need create a cluser and topic in kafka

Yoy can connect to management console on: localhost/9000

  1. Create cluster with the name of your choice
  2. Put cluster zookeeper host. kafkaserver
  3. Select Kafka Version 0.10.1.0
  4. Create some topic

In case of Windows SO, we need one more thing.

In order to connect to Kafka in Docker from the Windows host, we need to map Kafka container hostname to the localhost, by editing hosts file:

C:\Windows\System32\drivers\etc\hosts

Append this line: 127.0.0.1 kafkaserver

Testing Apache Kafka on Windows

Download Apache Kafka Distribution https://kafka.apache.org/downloads and choose the 0.10.1.0 distribution in our case

Kafka Consumer script

.\kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic topic1

Kafka Producer script

.\kafka-console-producer.bat --broker-list localhost:9092 --topic topic1
c

About

POC about uses of Akka Stream with Camel (rabbitmq) and Kafka with backpressure

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published