Skip to content

Conversation

@dc1992
Copy link
Contributor

@dc1992 dc1992 commented Jan 30, 2025

In this PR I removed the boot parameter that was used to activate the deduplication. From now, to activate the deduplication you just need to define a publisherRef value.

I also fixed a race condition when sending multiple messages concurrently with deduplication actived.

@dc1992 dc1992 linked an issue Jan 30, 2025 that may be closed by this pull request
Copy link
Collaborator

@Gsantomaggio Gsantomaggio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To use the deduplication, the client needs to expose an API to pass the publishingid; otherwise it does not make sense :)

See for example the Go-client:
https://github.com/rabbitmq/rabbitmq-stream-go-client/blob/main/examples/deduplication/deduplication.go#L66-L84
where the user must provide the id for each message to avoid duplications

or the .NET client where with the message you can pass the id the API
https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/blob/main/RabbitMQ.Stream.Client/Reliable/DeduplicatingProducer.cs#L71

@dc1992
Copy link
Contributor Author

dc1992 commented Jan 30, 2025

To use the deduplication, the client needs to expose an API to pass the publishingid; otherwise it does not make sense :)

See for example the Go-client: https://github.com/rabbitmq/rabbitmq-stream-go-client/blob/main/examples/deduplication/deduplication.go#L66-L84 where the user must provide the id for each message to avoid duplications

or the .NET client where with the message you can pass the id the API https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/blob/main/RabbitMQ.Stream.Client/Reliable/DeduplicatingProducer.cs#L71

Ok, but passing publishingid from outside is not mandatory, is it?
If you don't pass it from outside the client takes the next id increasing its own by one, right?

@Gsantomaggio
Copy link
Collaborator

Ok, but passing publishingid from outside is not mandatory, is it?

It is mandatory else the deduplication won't work. In this implementation, deduplication works like the standard producer.

@dc1992 dc1992 requested a review from Gsantomaggio January 31, 2025 15:27
@dc1992 dc1992 requested a review from Gsantomaggio February 3, 2025 11:18
Copy link
Collaborator

@Gsantomaggio Gsantomaggio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@dc1992 dc1992 merged commit 07da189 into main Feb 3, 2025
2 checks passed
@dc1992 dc1992 deleted the 230-change-stream-options-when-already-created branch February 3, 2025 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change stream options when already created

4 participants