spring-projects / spring-projects/spring-modulith
Marking publication of event completed updates more than one row
@odrotbohm is already working on this.
Since Jan 10, 2025.
- Dominant language
- Java
- Stars
- 1.2k
- Forks
- 222
- PR merge metrics
- No merged PRs in 30d
Description
I am testing out Spring Modulith and have a requirement to push an event to two SQS queues. For now, I'm trying to handle this fan-out by publishing two events like this:
applicationEventPublisher.publishEvent(new SqsOne(payload);
applicationEventPublisher.publishEvent(new SqsTwo(payload);
The definitions of SqsOne & SqsTwo have an @Externalized on them with their own queue arn, and that works fine. The issue is once one of them completes, the update query updates multiple rows in one go. This is because only serialized_event & listener_id are in the where clause, and they are the same for a given payload as the listener_id is the same for all Externalized Listeners.
I realize using SNS for fanout, utilizing a unique field in each wrapper class, or a custom serializer would resolve this, but are there are any plans to incorporate id or and/or event_type into the update where clause so this scenario is handled by default?
I suppose supporting multiple @Externalized on a class/record would also handle this scenario quite well as it would provide native fan-out functionality.
Thanks for brining this framework to life and continuing to advance it!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.