Skip to content

Allow delaying the initial message consumption #4392

@bruno-baehr

Description

@bruno-baehr

Expected Behavior
Allow configuring an initial delay before the first message processing when using @RetryableTopic.
This would make it possible to postpone the first consumption attempt for a configurable amount of time, instead of processing the message immediately after it is received.

Current Behavior
Currently, messages are processed immediately after being consumed, and delays only apply to retry attempts after a failure.
There is no way to delay the first processing attempt when the message is initially received.

Context
In my use case, I call a third-party API that starts an asynchronous process. Right after that, I publish a Kafka message to call another endpoint from the same API and retrieve the final result.
The issue is that this second endpoint is only ready about 1 minute later. Since the message is consumed immediately, the first processing attempt happens too early.
A configuration to delay the first message processing would help in scenarios where external systems need some time before the data becomes available.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions