spring-modulith icon indicating copy to clipboard operation
spring-modulith copied to clipboard

Support extracting event publication identifiers from the event itself

Open odrotbohm opened this issue 2 years ago • 0 comments
trafficstars

#251 pointed at the fact that the database access to mark event publications as completed suffers from the need to query for event payload and publication target identifier. This stems from the fact that the completion is persisted in an interceptor around the target listener, which does not have access to the original event publication's identifier (as it only sees the listener method's argument).

To optimize the data access by using the primary key, we can provide a user-facing SPI that allows extracting an identifier from the actual event payload, defaulting to support jMolecules Identifiable / @Identity out of the box. Uses should be able to declare custom extractors by declaring instances of the interface as Spring bean.

odrotbohm avatar Aug 09 '23 18:08 odrotbohm