简体   繁体   中英

How to make the publish receive messages?

I have a school assignment to do using RabbitMQ. It's a project of a stock exchange, using topics to send messages only for the ones interested on that messages. So a example is, a broker wants to buy some stock, let's say from Apple, so he is going to send the message to buy it, there is a format of message to send, he is going to send that message to a queue, the stock exchange will get that message and process it to see if some other client is selling from Apple, this case Apple is a topic, if the value matches then it will process the transaction. Ok here. My doubt is, how to make the broker who is buying also receive messages? Because one of the requirements of the assignment is that every broker need to receive all messages of the topic they are interested. So the client who send message to buy, also is going to receive messages.

I've done the tutorial from RabbitMQ, I did 5 of them. RabbitMQ Get started . On the tutorial I learned how to send messages to a subscribe, but it doesn't say how the publish can also receive messages.

Use spring-messaging! https://spring.io/guides/gs/messaging-rabbitmq/

The docs should be fairly clear about how to send/receive messages. It's neat little library. Of course your project needs to be a spring app.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM