Skip to content

Instantly share code, notes, and snippets.

@ben-ole
Last active July 3, 2018 12:34
Show Gist options
  • Save ben-ole/53592af2b1a259ea922f51111c6c7f64 to your computer and use it in GitHub Desktop.
Save ben-ole/53592af2b1a259ea922f51111c6c7f64 to your computer and use it in GitHub Desktop.
Kafka publisher
defmodule Sample.Publisher do
def publish(event_name, payload, context \\ %{}, topic \\ :default) do
message_body = %{
payload: payload,
meta: event_metadata(event_name, context)
}
KaufmannEx.Publisher.publish(event_name, message_body, context)
end
def event_metadata(event_name, context) do
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment