Metadata availability inside aggregate

Hi,

I tried using @Metadata on an @Eventhandler method inside my aggregate, but it is null, while being set after the event is published.

I’m using the config below and add metadata to the commands.

@Bean
public CommandBus commandBus() {
SimpleCommandBus bus = new SimpleCommandBus();
bus.setTransactionManager(new SpringTransactionManager(axonTransactionManager()));
AuditingInterceptor auditingInterceptor = new AuditingInterceptor();
auditingInterceptor.setAuditDataProvider(new CommandMetaDataProvider());
bus.setHandlerInterceptors(Arrays.asList(auditingInterceptor));
return bus;
}

Is this intended?

regards
Geir

Hi Geir,

if you add a parameter of the MetaData type, can you see proper meta data being injected? Are you sure the parameter type declared on the @EventHandler allows for the meta data value to be injected?
The @MetaData parameter resolver is one of the default parameter resolvers, so it should work without any additional configuration.

Cheers,

Allard