KafkaMessageBus v4.2.3 KafkaMessageBus.Messages.MessageData.Factory View Source

A set of functions that take resource, action, and data as parameters and returns an instance of the appropriate message data struct. Each message data type will support a function new/1 that is a struct representation of the map data that it received. These new/1 functions do not alter or validate the data field values.

Link to this section Summary

Functions

This function is the entry point for the Factory module. It's parameters include the message data, the message resource, and the message action. The resource and action are used to determine the appropriate message_data struct. The parameter 'data' will be passed to that struct's new/1 function.

Link to this section Functions

Link to this function

create(data, resource, action, message_contract_exclusions \\ get_message_contract_exclusions(), factory_implementation \\ get_factory_implementation()) View Source

This function is the entry point for the Factory module. It's parameters include the message data, the message resource, and the message action. The resource and action are used to determine the appropriate message_data struct. The parameter 'data' will be passed to that struct's new/1 function.

Message contract exclusions are optional and will be pulled from the modules configuration by default. These possible message_contract_exclusions can be passed to create/4: :none - This means that there are no exclusions. :all - This means that all validation will be excluded. [exclusions] - This is a list of message_data structs that should be excluded from validation.

  • anything else will be treated as an error.
Link to this function

get_factory_implementation() View Source

Link to this function

get_message_contract_exclusions() View Source