InMemory Java

Consumer Project with RabbitMQ

By
on
February 28, 2021

Today we will create a new project (Consumer) and write to log messages coming from RabbitMQ (Producer).
I created a new project in EndlessHope, its name is Consumer and I did default config like Producer.

We always need a connection since we can get a message anytime. Therefore, we do not close connections.
We have only one block different from the Producer.

DeliverCallback deliverCallback = (String c, Delivery delivery) -> {
logger.info(new String(delivery.getBody(), "UTF-8"));
};

channel.basicConsume(rabbitmqQueuename, true, deliverCallback, consumerTag -> {
});

I know these post are quite short because I’m learning, and I try to write a post often both for my blog and also for you.

You can check all code here.
https://gitlab.com/sercantogrul/endless-hope

TAGS
RELATED POSTS

LEAVE A COMMENT

Sercan Toğrul
Java Developer - Kyrenia

I'm a java developer. I'm from Turkey but I live in Cyprus. You can see my skills and my notes here. Do you have a question you can send me email and I will answer!