rabbitmq远程调用使用
时间: 2023-10-25 12:09:13 浏览: 99
rabbitmq学习11:基于rabbitmq和spring-amqp的远程接口调用
要使用RabbitMQ进行远程调用,需要对远程调用进行配置。具体操作步骤可以参考一篇名为《解决RabbitMQ远程不能访问的问题》的文章,文章链接为http://www.linuxidc.com/Linux/2014-10/107917.htm。在该文章中,介绍了如何配置外部机器上的RabbitMQ,并进行远程调用的测试。
另外,在Java中进行远程连接调用RabbitMQ的实例代码也是可行的。你可以使用@RabbitListener注解来监听指定队列、指定exchange、指定routingKey的消息。同时,@RabbitListener还具有创建队列、exchange和routingKey的功能。为了启动这个功能,你需要创建一个启动类,如下所示:
```java
@SpringBootApplication
public class RabbitMQApp {
public static void main(String[] args) {
SpringApplication.run(RabbitMQApp.class, args);
}
}
```
通过以上步骤,你就可以在Java中使用RabbitMQ进行远程调用了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [RabbitMQ远程调用测试用例](https://blog.csdn.net/weixin_35997546/article/details/116845963)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [java远程连接调用Rabbitmq的实例代码](https://download.csdn.net/download/weixin_38648396/12776702)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [springboot+rabbitMQ实现RPC远程调用](https://blog.csdn.net/u010395024/article/details/105191699)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文