Java / Spring - send RabbitMQ message from internal consumer

Is it legal and safe to send a message to another queue from the user of the current queue?

public void onMessage(){
    //save to db
    Order o=myservice.create(order);

    Object o=rabbitTemplate.convertSendAndReceive(queue2,orderId);   
}

I think that in this case the second-line consumer may not see the saved order, because the transaction will be completed only after the onMessage method is released.

And is it safe and legal to send messages from consumers?

+4
source share
1 answer

Yes, it is completely legal and safe, looking from the rabbit or ampp side.

, -, . M, S () M B, , S, ? , , - A - S , B M. - , . A , " " .

+2

All Articles