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 batch processing always duplicates multiples of max.poll.records #2549

Open
itatdcer opened this issue Mar 21, 2024 · 2 comments
Open
Labels

Comments

@itatdcer
Copy link

Using the option mp.messaging.incoming.$channel.batch=true, always result in duplicate records, multiple of max.poll.records configuration.

In a processing "pipeline" like

`@Incoming("inbound-channel")
@Outgoing("outbound-channel")
public Multi<Message<byte[]>> process(Message<List<byte[]>> msg) {

    return Multi.createFrom()
            .items(() -> {

                return service.apply(msg).stream()
                        .map(result -> {
                            
                            msg.ack().toCompletableFuture().complete(null);
                            if (result != null) {
                                return result;
                            }

                            return null;

                        });

            })
            .runSubscriptionOn(Infrastructure.getDefaultWorkerPool())
            .onCompletion().ifEmpty().continueWith(() -> {
                msg.ack().toCompletableFuture().complete(null);
                return List.of();
            });
}`

The output topic is always filled with the number of input messages plus n x "max.poll.records`".

@SivaM07
Copy link

SivaM07 commented May 14, 2024

@itatdcer, I recently debugged duplicates on the non batch message processing, let me know if you are still trying to troubleshoot, I can help you with that

@cescoffier
Copy link
Contributor

Do you have a reproducer?

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

No branches or pull requests

4 participants