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

Improve documentation of how to recover from Acknowledgement timeout #186

Open
matsev opened this issue Nov 8, 2024 · 0 comments
Open
Labels
type/enhancement A general enhancement

Comments

@matsev
Copy link

matsev commented Nov 8, 2024

Documentation issue

Improve documentation of how to recover from Acknowledgement timeout

Motivation

It is currently unclear for me how an application can recover from an Acknowledgement timeout.

We are using the Reactor RabbitMQ client library configured with consumeManualAck. Occasionally, we observe the following error in our logs:

c.r.c.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - delivery acknowledgement on channel 5 timed out. Timeout value used: 1800000 ms. This timeout value can be configured, see consumers doc guide to learn m...

After this statement (presumably logged by this statement), the channel is promptly shut down, the Reactive Flux is terminated and message processing stops consequently.

The client has been configured with a retry ack exception handler in an attempt to mitigate connection failures:

    Receiver receiver = RabbitFlux.createReceiver();

    ConsumeOptions consumeOptions = new ConsumeOptions()
        .exceptionHandler(new ExceptionHandlers.RetryAcknowledgmentExceptionHandler(
            Duration.ofSeconds(10), 
            Duration.ofMillis(200),
            ExceptionHandlers.CONNECTION_RECOVERY_PREDICATE
        ));

    receiver.consumeManualAck("queue_name", consumeOptions)
        .subscribe(delivery -> {
            // message processing omitted
            // acknowledge message
            delivery.ack();
        });

However, we must have overlooked something as the problem is still observed from time to time.

Desired solution

A documented way for the Receiver or Flux to recover from Acknowledgement timeouts similar to the one described above.

Considered alternatives

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant