Sending Spring domain events using a custom ApplicationEventPublisher

I'm trying to implement an application using Spring Boot/Spring Data, following DDD architecture guidelines. I have an Aggregate Root which publish domain events using the method AbstractAggregateRoot::registerEvent() . Furthermore, I need to intercept those events for Logging/Tracing purposes so I decided to make an experiment:

First, implement a custom ApplicationEvent Publisher

public class CustomEventPublisher implements ApplicationEventPublisher {
    private final ApplicationEventPublisher publisher;

    private final Logger logger = getLogger(CustomEventPublisher.class);

    public CustomEventPublisher(ApplicationEventPublisher publisher) {
        this.publisher = publisher;

    public void publishEvent(ApplicationEvent event) {"sending an event...");


And then registering as bean

public class CustomEventPublisherConfig {

    public ApplicationEventPublisher getCustomEventPublisher(ApplicationEventPublisher publisher , RabbitTemplate rabbitTemplate) {
        return new CustomEventPublisher(publisher, rabbitTemplate);

this works fine once I explicitly publish events from some sample object with an injected ApplicationEventPublisher

public void pub() {
    publisher.publishEvent(new Event(this , 1));

public void sub(Event e) {
    this.value = e.getValue();

and I got the "sending an event..." log entry

then I've tried to define the aggregate root

public class AggregateRoot extends AbstractAggregateRoot {

    private Long id;

    private int value = 0;

    public AggregateRoot setValue(int value) {
        registerEvent(new Event(this , value));
        return this;


public void pub() { AggregateRoot().setValue(1));

Test pass again but I can clearly see that Spring Data is not using the CustomEventPublisher. I've tried to understand if there is some way to intercept call and override the default behaviour, this approach could work even if needs to reinvent the wheel (I don't think that the domain event publishing code is so complicated though) but the only thing I've found is about Spring Data REST that is out of my scope

Any suggestion to overcome this problem?

Thanks in advance