搶先一步
VMware 提供培訓和認證,以加速您的進展。
了解更多Spring Cloud Bus 使用輕量級消息代理連接分散式系統的節點。然後,這可以用於廣播狀態變更(例如,配置變更)或其他管理指令。AMQP 和 Kafka 代理實現在專案中已包含。或者,在類路徑上找到的任何 Spring Cloud Stream binder 都可以作為傳輸方式直接使用。
只要 Spring Cloud Bus AMQP 和 RabbitMQ 在類路徑上,任何 Spring Boot 應用程式都將嘗試連線到 localhost:5672
上的 RabbitMQ 伺服器 (spring.rabbitmq.addresses
的預設值)
@Configuration
@EnableAutoConfiguration
@RestController
public class Application {
@RequestMapping("/")
public String home() {
return "Hello World";
}
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}