Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kafka consumer unable to connect to Kafka after Kafka restart #340

Open
Avinashshetty44 opened this issue Apr 20, 2023 · 1 comment
Open
Labels
❓need-triage This issue needs triage, hasn't been looked at by a team member yet

Comments

@Avinashshetty44
Copy link

Avinashshetty44 commented Apr 20, 2023

Kafka Receiver is unable to consume messages from a topic after Kafka is restarted.

public void subscribeAndUpdatePipelineStatues(String topic) {
    ReceiverOptions<String, byte[]> receiverConfig = getReceiverConfig(topic);
    pipelineStatusKafkaReceiver = KafkaReceiver.create(
        receiverConfig.subscription(Collections.singleton(topic)));
    pipelineStatusKafkaReceiver.receive()
        .retryWhen(Retry.backoff(300, Duration.of(10L, ChronoUnit.SECONDS)))
        .doOnError(throwable -> LOGGER.error("Error from retry"))
        .subscribe(
            receiverRecord -> Mono.just("Kafka: Listening Pipeline status on {}")
                .doOnEach(logOnNext(s -> LOGGER.info(s, topic)))
                .flatMap(s -> updatePipelineStatus(receiverRecord))
                .doOnSuccess(receiveRecord -> `receiverRecord.receiverOffset().acknowledge())`
                .subscribe());

Scenario:
Initially, the Kafka receiver worked as expected but once the Kafka broker restarts and comes back, the same receiver is unable to receive messages and there's no error seen in the logs except warn

We followed the approach mentioned here in the documentation: https://projectreactor.io/docs/kafka/release/reference/#_error_handling_2
Kafka reactor version: 1.3.10
Please let us know the solution

@reactorbot reactorbot added the ❓need-triage This issue needs triage, hasn't been looked at by a team member yet label Apr 20, 2023
@garyrussell
Copy link
Contributor

If it still occurs with 1.3.17; please provide complete instructions to reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❓need-triage This issue needs triage, hasn't been looked at by a team member yet
Projects
None yet
Development

No branches or pull requests

3 participants