Annotation Interface DropProtectedData


@Target({METHOD,CONSTRUCTOR}) @Retention(RUNTIME) public @interface DropProtectedData
Indicates that a message handler method or constructor is the final usage point for protected data.

When a handler is annotated with @DropProtectedData, any ProtectData-annotated fields in the payload will be injected for this invocation. After the handler method completes, the protected data will be permanently deleted from persistence.

This annotation is useful to ensure that sensitive data does not linger longer than needed, satisfying data minimization principles and privacy requirements (e.g. GDPR).

Example


 @HandleEvent
 @DropProtectedData
 void handle(RegisterCitizen event) {
     // Use sensitive data for validation or audit
     audit(event.getSocialSecurityNumber());
     // After this handler, the socialSecurityNumber is permanently removed from storage
 }
 
See Also: