Creating a message producer/message consumer

Having restructured our application to make room for comments, let's get to it!

First of all, we need to add a new dependency to our build file, which is done with the following code:

    compile('org.springframework.boot:spring-boot-starter-amqp')

That will give us access to Spring AMQP, which includes RabbitMQ support.

Adding messaging technology to our application may make us clamor to, well, write some code that talks to RabbitMQ. But that isn't really a good flow. Instead, we should start from one of two perspectives--writing a unit test or writing some UI.

Either approach is aimed at figuring out the use case we are trying to solve. Before solving the problem at hand, we need to noodle out what our exact problem is. In this case, let's start from the UI perspective.

To do that, we can take advantage of Spring Boot DevTools from the last chapter and launch our application in the Debug mode with the LiveReload feature enabled. That way, as we make changes, we can see them right away:

With this preceding screenshot, we can see our application up and running with the LiveReload server enabled (and some sample data preloaded).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.19.185