Last active
July 3, 2018 12:34
-
-
Save ben-ole/53592af2b1a259ea922f51111c6c7f64 to your computer and use it in GitHub Desktop.
Kafka publisher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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