[英]How to make the publish receive messages?
I have a school assignment to do using RabbitMQ. 我有一个学校作业要使用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.
所以一个例子是,经纪人想要购买一些股票,让我们说来自Apple,所以他将发送消息购买它,有一种格式的消息要发送,他将把该消息发送到队列,证券交易所将获得该消息并处理它以查看是否有其他客户从Apple销售,这种情况Apple是一个主题,如果价值匹配则它将处理交易。 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的教程,我做了其中的5个。 RabbitMQ Get started .
RabbitMQ入门 。 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/
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.
当然,您的项目需要是一个春季应用程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.