Install Rabbitmq-server
The Publisher create a Request Object which contains three fields two operands and oprator
public class Request implements Serializable{
private double valeur1;
private double valeur2;
private String operator;
//...
}Then send it to the Publisher using basicPublish() of Channel Object
channel.basicPublish("", requestQueueName, props, data);The Consumer receive the Request Object then parse it. Then send the response to the Publisher using Queues.
public class Response implements Serializable{
private String msg;
private Status status;
//...
}
public static enum Status {
SUCCESS,
ERROR
}The communication between the two Components ensured RabbitMQ