MessageOut Event
Fires when a message is published.
Syntax
public event OnMessageOutHandler OnMessageOut; public delegate void OnMessageOutHandler(object sender, AmqpclassicMessageOutEventArgs e); public class AmqpclassicMessageOutEventArgs : EventArgs { public string ChannelName { get; } public string ExchangeName { get; } public string RoutingKey { get; } public string MessageId { get; } public long DeliveryTag { get; } public bool Accepted { get; } }
Public Event OnMessageOut As OnMessageOutHandler Public Delegate Sub OnMessageOutHandler(sender As Object, e As AmqpclassicMessageOutEventArgs) Public Class AmqpclassicMessageOutEventArgs Inherits EventArgs Public ReadOnly Property ChannelName As String Public ReadOnly Property ExchangeName As String Public ReadOnly Property RoutingKey As String Public ReadOnly Property MessageId As String Public ReadOnly Property DeliveryTag As Long Public ReadOnly Property Accepted As Boolean End Class
Remarks
This event fires anytime a message is published; or after an outgoing message has been acknowledged by the server, if the channel it was published on is in "publish confirmations" mode.
ChannelName reflects the name of the channel the message was published on.
ExchangeName reflects the name of the exchange the message was published to. (If the message was published to the server's default exchange, whose name is always the empty string, ExchangeName will also be empty.)
RoutingKey reflects the routing key that the message was published with.
MessageId reflects the message's unique Id, if one was set.
DeliveryTag reflects the channel-specific delivery tag number for the message. (Note that this is only populated for messages published on a channel in "publish confirmations" mode; otherwise it will be set to -1.)
Accepted indicates whether the server published back a positive True or negative False acknowledgement for the outgoing message. Note that this is only valid for messages published on a channel in "publish confirmations" mode; Accepted will always be True messages published on a channel in normal or transaction mode.
Refer to EnablePublishConfirms for more information about channels in "publish confirmations" mode.