首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >http-客户端不包括在春季-兔子

http-客户端不包括在春季-兔子
EN

Stack Overflow用户
提问于 2018-06-19 14:45:21
回答 1查看 1.1K关注 0票数 2

我在http-client Spring 1.5.6中与spring-rabbit一起使用运行良好。

SpringBoot2.0.2中,excluded http-client被排除在spring-rabbit pom.xml之外。

我不想手动添加http-client并跟踪引导版本之间的版本。

spring-boot-starter-amqp-1.5.6.RELEASE

代码语言:javascript
复制
<dependency>
    <groupId>org.springframework.amqp</groupId>
    <artifactId>spring-rabbit</artifactId>
</dependency>

spring-boot-starter-amqp-2.0.2.RELEASE

代码语言:javascript
复制
<dependency>
  <groupId>org.springframework.amqp</groupId>
  <artifactId>spring-rabbit</artifactId>
  <version>2.0.3.RELEASE</version>
  <scope>compile</scope>
  <exclusions>
    <exclusion>
      <artifactId>http-client</artifactId>
      <groupId>com.rabbitmq</groupId>
    </exclusion>
  </exclusions>
</dependency>

为什么http-client被排除在外,我可以在不定义版本的情况下包含它吗?版本是2.0.1.RELEASE,但它不是作为spring-rabbit中的属性提取的。

EN

回答 1

Stack Overflow用户

发布于 2018-10-25 14:10:41

根据Spring文档,依赖com.rabbitmq:http-client现在是可选的。显然,这被更改为允许多个客户端实现。

启用管理插件后,RabbitMQ服务器将公开一个REST来监视和配置代理。现在提供了API的Java绑定。com.rabbitmq.http.client.Client是一个标准的,即时的,因此,阻塞的API。它基于Spring模块及其RestTemplate实现。另一方面,com.rabbitmq.http.client.ReactorNettyClient是一个基于反应堆Netty项目的反应性的、非阻塞的实现。 跃点依赖项(com.rabbitmq:http-client)现在也是可选的。

  • 客户端:即时和阻塞的客户端
  • ReactorNettyClient:一个反应性和非阻塞的客户端

见文件

如果要使用标准的http,可以添加依赖项。请不要自己跟踪正确的版本。该版本将根据您的spring-boot-starter-amqp版本自动选择。

代码语言:javascript
复制
// Maven
<dependency>
  <groupId>com.rabbitmq</groupId>
  <artifactId>http-client</artifactId>
</dependency>

// Gradle
compile("com.rabbitmq:http-client")

还可以参考相关的GitHub项目,说明如何启用特定的客户端:狂犬病/跳

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50931205

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档