SpringCloud 整合方式

2023-12-10 21:53 更新

您可以使用以下四種集成配置之一:

  • 阿帕奇駱駝
  • Spring Integration
  • Spring Cloud Stream
  • Spring AMQP

由于我們使用Spring Boot,因此,如果您已將這些庫(kù)之一添加到類路徑中,則會(huì)自動(dòng)設(shè)置所有消息傳遞配置。

 請(qǐng)記住將@AutoConfigureMessageVerifier放在生成的測(cè)試的基類上。否則,Spring Cloud Contract驗(yàn)證程序的消息傳遞部分將不起作用。

如果要使用Spring Cloud Stream,請(qǐng)記住對(duì)org.springframework.cloud:spring-cloud-stream-test-support添加依賴項(xiàng),如下所示:

Maven. 

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-stream-test-support</artifactId>
    <scope>test</scope>
</dependency>

Gradle. 

testCompile "org.springframework.cloud:spring-cloud-stream-test-support"


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)