carotte/publisher
Types
pub type PublishOption {
Mandatory(Bool)
ContentType(String)
ContentEncoding(String)
Persistent(Bool)
CorrelationId(String)
Priority(Int)
ReplyTo(String)
Expiration(String)
MessageId(String)
Timestamp(Int)
Type(String)
UserId(String)
AppId(String)
}
Constructors
-
Mandatory(Bool)
If set, returns an error if the broker can’t route the message to a queue
-
ContentType(String)
MIME Content type
-
ContentEncoding(String)
MIME Content encoding
-
Persistent(Bool)
If set, uses persistent delivery mode. Messages marked as persistent that are delivered to durable queues will be logged to disk
-
CorrelationId(String)
Arbitrary application-specific message identifier
-
Priority(Int)
Message priority, ranging from 0 to 9
-
ReplyTo(String)
Name of the reply queue
-
Expiration(String)
How long the message is valid (in milliseconds)
-
MessageId(String)
Message identifier
-
Timestamp(Int)
timestamp associated with this message (epoch time)
-
Type(String)
Message type
-
UserId(String)
Creating user ID. RabbitMQ will validate this against the active connection user
-
AppId(String)
Application ID
Functions
pub fn publish(
channel channel: Channel,
exchange exchange: String,
routing_key routing_key: String,
payload payload: String,
options options: List(PublishOption),
) -> Result(Nil, CarotteError)
Publish a message ‘payload’ to an exchange
The routing_key
is used to filter messages from the exchange
The options
are used to set message properties