简体   繁体   English

如何使发布接收消息?

[英]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.

相关问题 如何使客户端服务器Java应用程序在一个端口上发送消息,而在另一个端口上接收消息? - How do I make a client-server Java application to send messages on one port but receive them on another? 如何使TCP客户端发送请求并接收响应。还接受服务器推送的消息 - How to make TCP client which send request and receive response .Also accepts the messages pushed from server 如何使用Micronaut和RabbitMQ消费和发布消息? - How consume and publish messages with Micronaut and RabbitMQ? 如何使用Java将消息发布到EMS主题 - How to publish messages to EMS Topic using Java 如何以高 tps、多线程向rabbitmq 发布消息 - How to publish messages to rabbitmq with high tps, multithreading 如何从USB设备接收消息 - How to receive messages from a usb device 如何接收系统日志消息并将其转换为字符串 - How to receive syslog messages and convert them to string 如何在quickfix上发送和接收消息? - How can I send and receive messages on quickfix? Java Servlet:如何实例化线程和接收消息 - Java Servlet: How to instantiate thread and receive messages 如何接收来自特定号码的短信? - How to receive SMS messages from a specific number?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM