我尝试过这个,但没有帮助
春天: 自动配置: 排除: - org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration - org.springframework.boot.actuate.autoconfigure.metrics.KafkaMetricsAutoConfiguration - org.springframework.cloud.stream.config.BindingsEndpointAutoConfiguration - org.springframework.cloud.stream.config.ChannelBindingAutoConfiguration - org.springframework.cloud.stream.config.ChannelsEndpointAutoConfiguration - org.springframework.cloud.stream.config.BindersHealthIndicatorAutoConfiguration
有时,即使您将
spring.kafka.consumer.enabled
和 spring.kafka.producer.enabled
设置为 false
,Kafka 组件也会由 Spring Boot 自动配置。更明确地说,您可以在主应用程序类中排除 KafkaAutoConfiguration
类。
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration;
@SpringBootApplication(exclude = KafkaAutoConfiguration.class)
public class YourApplication {
public static void main(String[] args) {
SpringApplication.run(YourApplication.class, args);
}
}
application.yaml
(或application.properties
)logging:
level:
org.springframework.boot.autoconfigure: DEBUG
使用此命令签入 Azure eventhub 命名空间 -
az eventhubs eventhub list --resource-group <resource-group-name> --namespace-name <namespace-name>
。