Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
Message persistence support (#119)
Browse files Browse the repository at this point in the history
Fixes #118 and formats docs correctly
  • Loading branch information
akoutmos authored and mkorszun committed Oct 18, 2019
1 parent fc1b6db commit d2caa9b
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions lib/publisher.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,23 @@ defmodule GenRMQ.Publisher do
require Logger

# list of fields permitted in message metadata at top level
@metadata_fields :P_basic
|> Record.extract(from_lib: "rabbit_common/include/rabbit_framing.hrl")
|> Keyword.keys()
@metadata_fields ~w(
mandatory
immediate
content_type
content_encoding
persistent
priority
correlation_id
reply_to
expiration
message_id
timestamp
type
user_id
app_id
cluster_id
)a

##############################################################################
# GenRMQ.Publisher callbacks
Expand Down Expand Up @@ -97,11 +111,11 @@ defmodule GenRMQ.Publisher do
`routing_key` - optional routing key to set for given message
`metadata` - optional metadata to set for given message. Keys that
are not allowed in metadata are moved under the `:headers`
field. Do not include a `:headers` field here: it will be
created automatically with all non-standard keys that you have
provided.
`metadata` - optional metadata to set for given message. Keys that \
are not allowed in metadata are moved under the `:headers` \
field. Do not include a `:headers` field here: it will be \
created automatically with all non-standard keys that you have \
provided. For a full list of options see `AMQP.Basic.publish/5`
## Examples:
```
Expand Down

0 comments on commit d2caa9b

Please sign in to comment.