I have a JAX-RS based application with 2 main components. 1. Core: Which talks to the database and has business logic 2. API: Which takes the REST requests from the UI, sends to the core, retreives the response and sends it back to the UI (war file with the core as a jar dependency)
Now, we want to use RabbitMQ to handle the requests/responses. So it should be API ---> Queue ---> Core and back the same way.
I'm using Maven to build my project and Eclipse as the IDE.
I've found some stuff online and have used the following link to setup my ptoject: http://ift.tt/1LutBXn
My question is, how do i keep listening to the queue and adding to the queue without using the main mehtod. If I add a new method inside the sender class called putMessage, with the same logic as the main, and invoke this method from my API, I cannot see any messages in the queue. I am running the API on tomcat. Do I need one more instance of Tomcat on which to deploy the listener?
Aucun commentaire:
Enregistrer un commentaire