Sending the messages to the broker

This is the most interesting part now. When we want to save the TrackedHashTag, we must send the pretty new entity to the RabbitMQ. This process will send the message, and then the Twitter Gathering microservice will start to consume the stream in ten seconds.

We need to change the TrackedHashTagService a little bit; the final version should look like this:

package springfive.twittertracked.domain.serviceimport org.springframework.amqp.rabbit.core.RabbitTemplateimport org.springframework.beans.factory.annotation.Valueimport org.springframework.stereotype.Serviceimport reactor.core.publisher.Monoimport springfive.twittertracked.domain.TrackedHashTagimport springfive.twittertracked.domain.repository.TrackedHashTagRepository ...

Get Spring 5.0 By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.