off_broadway_kafka v0.5.1 OffBroadway.Kafka.Producer
Implements the logic to handle incoming messages through
the broadway pipeline. Sends messages to the handle_info/2
and handle_demand/2
functions based on requests and tracks
acknowledgements in state.
Link to this section Summary
Functions
Handle message events based on demand. Updates the demand based on the existing demand in state and sends the requested number of message events.
Handle assignments revoked by kafka broker. Should wait until acknowledgers and reported as empty and clean out any events in queue
Convenience function for sending messages to be
produced via the handle_info/2
function.
Names the producer process and initializes state for the producer GenServer.
Starts an OffBroadway.Kafka producer process linked to the current process.
Handles termination of the Elsa consumer group supervisor process if one exists.
Link to this section Functions
handle_demand(demand, state)
Handle message events based on demand. Updates the demand based on the existing demand in state and sends the requested number of message events.
handle_info(arg, state)
Handle assignments revoked by kafka broker. Should wait until acknowledgers and reported as empty and clean out any events in queue
Convenience function for sending messages to be
produced via the handle_info/2
function.
init(args)
Names the producer process and initializes state for the producer GenServer.
- if args contain a value for :brokers or :endpoints, creates a handler config and passes it to the Elsa library to start a consumer group supervisor and store the returned pid in the Broadway Producer state for reference.
start_link(opts)
Starts an OffBroadway.Kafka producer process linked to the current process.
terminate(reason, arg2)
Handles termination of the Elsa consumer group supervisor process if one exists.