Open bumbus opened 5 years ago
You can include any metadata during command dispatch. It will be copied onto any events created by the command.
ExampleRouter.dispatch(command,
metadata: %{"issuer_id" => issuer_id, "user_id" => "user@example.com"}
)
Metadata is a useful place to record detais about the originating request (IP address, authenticated user id, etc.).
thank you very much for helping out
Hi, this might be a noobish question, but I could not figure out how to write into events.metadata. As I see it, maybe correct me if I am wrong, this would be the right place to save for example (phoenix) connection information like user IP etc.
Thanks fro advance.