У меня нет проблем с получением событий простоя при использовании именованного связывателя ...
spring.cloud.stream.binders.mykafka.type=kafka
spring.cloud.stream.bindings.input.binder=mykafka
и
@StreamListener(Sink.INPUT)
public void foo(String in) {
System.out.println(in);
}
@EventListener
public void events(KafkaEvent event) {
System.out.println(event);
}
и
ListenerContainerIdleEvent [idleTime=30.017s, listenerId=[Ljava.lang.String;@2b214b94.container-0, container=KafkaMessageListenerContainer [id=[Ljava.lang.String;@2b214b94.container-0, clientIndex=-0, topicPartitions=[input-0]], paused=false, topicPartitions=[input-0]]
ListenerContainerIdleEvent [idleTime=60.037s, listenerId=[Ljava.lang.String;@2b214b94.container-0, container=KafkaMessageListenerContainer [id=[Ljava.lang.String;@2b214b94.container-0, clientIndex=-0, topicPartitions=[input-0]], paused=false, topicPartitions=[input-0]]
ListenerContainerIdleEvent [idleTime=90.056s, listenerId=[Ljava.lang.String;@2b214b94.container-0, container=KafkaMessageListenerContainer [id=[Ljava.lang.String;@2b214b94.container-0, clientIndex=-0, topicPartitions=[input-0]], paused=false, topicPartitions=[input-0]]
ListenerContainerIdleEvent [idleTime=120.072s, listenerId=[Ljava.lang.String;@2b214b94.container-0, container=KafkaMessageListenerContainer [id=[Ljava.lang.String;@2b214b94.container-0, clientIndex=-0, topicPartitions=[input-0]], paused=false, topicPartitions=[input-0]]
ListenerContainerIdleEvent [idleTime=150.091s, listenerId=[Ljava.lang.String;@2b214b94.container-0, container=KafkaMessageListenerContainer [id=[Ljava.lang.String;@2b214b94.container-0, clientIndex=-0, topicPartitions=[input-0]], paused=false, topicPartitions=[input-0]]