Very interesting question, thank you for raising it.
Looking through the code, there is no way to plugin a second AuditorAware bean and have the system select between them by return type. Spring builds even its own internal beans based on this assumption.
You would have to (based on a preliminary research):
- create an interface similar to AnnotationAuditingConfiguration interface that is aware that there are several beans of type AuditorAware
- create an AuditHandler implementation that can distinguish between AuditorAware instances, based on return type
- modify/override the AuditingBeanDefinitionRegistrarSupport to construct the type-aware AuditHandler mentioned earlier
- provide an annotation that imports the overridden registrar
Quite a handful :))