AuditingInterceptor in Axon 3.0

106 views
Skip to first unread message

Yoram Kulbak

unread,
Jan 11, 2017, 7:28:16 PM1/11/17
to Axon Framework Users
Hi,

Yet another "How do I port Axon 2.x -> 3.0 functionality" question:

We use AuditingInterceptor  to ensure that any metadata attached to a command is stored as metadata on the events emitted as a result of processing it. 

How should we port this functionality to Axon 3.0 ?

Thanks,
Yoram

Allard Buijze

unread,
Jan 12, 2017, 10:42:49 AM1/12/17
to Axon Framework Users
Hi Yoram,

there is a CorrelationDataInterceptor that allows you to register meta data with the Unit of Work (using registerCorrelationDataProvider(...) ). That MetaData is automatically attached to all messages created in the scope of that Unit of Work.

If you use Spring Autoconfiguration or the Axon Configuration API to define your components, you will get an interceptor that automatically adds a correlationId and traceId to all the messages (see MessageOriginProvider).

Cheers,

Allard

--
You received this message because you are subscribed to the Google Groups "Axon Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yoram Kulbak

unread,
Jan 12, 2017, 6:33:30 PM1/12/17
to Axon Framework Users
thanks

Simone Ricciardi

unread,
Jan 18, 2017, 4:26:51 AM1/18/17
to Axon Framework Users
Hi Allard,
what is the way to register my own CorrelationDataProvider using Spring Boot?

thanks,
Simone.

Allard Buijze

unread,
Jan 18, 2017, 4:42:16 AM1/18/17
to Axon Framework Users
Hi Simone,

while checking the code for how these things are wired, it seems like there is currently no Spring-friendly way of wiring them. They are provided by the AxonConfiguration, but it there is no way to get them in there using Spring (at least not without doing something 'dirty').

It's a simple change to get them 'autowired' based on their availability in the application context.
I have submitted issue #240.

Thanks!

Allard

Simone Ricciardi

unread,
Jan 18, 2017, 4:54:45 AM1/18/17
to Axon Framework Users
Thanks!
Did you plan to release the 3.0.1 version soon?
In the meantime I'll try to fix my issue in the 'dirty' way...  

Simone.

Allard Buijze

unread,
Jan 18, 2017, 4:56:01 AM1/18/17
to Axon Framework Users
Yes, 3.0.1 should be available early next week

Simone Ricciardi

unread,
Jan 18, 2017, 5:04:39 AM1/18/17
to Axon Framework Users
Perfect!

Thanks,
Simone.
Reply all
Reply to author
Forward
0 new messages