Metadata is all the “additional” information that resides with a emitted event, some of which is required information.
In EventFlow metadata is merely a
KeyValuePair<string,string> for which each is a metadata entry.
Out of the box these metadata keys are added to each aggregate event.
event_version- A name and version for the event which is used during event deserialization.
DateTimeOffsetfor when the event was emitted from the aggregate.
aggregate_sequence_number- The version the aggregate was after the event was emitted, e.g.
1for the very first event emitted.
Custom metadata provider¶
If you require additional information to be stored along with each
event, then you can implement the
IMetadataProvider interface and
register the class using e.g.
Additional built-in providers¶
EventFlow ships with a collection of ready-to-use providers in some of its NuGet packages.
event_type_assembly_name- Assembly name of the assembly containing the event
event_type_assembly_version- Assembly version of the assembly containing the event
event_type_fullname- Full name of the event corresponding to
Type.FullNamefor the aggregate event type.
guid- A new
Guidfor each event.
environment_machinename- Adds the machine name handling the event from
request_header[HEADER]- Adds all headers from the OWIN request as metadata, each as a separate entry for which
HEADERin the is replace with the name of the header. E.g. the
request_header[Connection]might contain the value
request_uri- OWIN request URI.
request_method- OWIN request method.
user_host_address- The provider tries to find the correct user host address by inspecting request headers, i.e., if you have a load balancer in front of your application, then the request IP is not the real user address, but the load balancer should send the user IP as a header.
user_host_address_source_header- The header for of which the user host address was taken.
remote_ip_address- The remote IP address. Note that this might be the IP address of your load balancer.