コード例 #1
0
 /// <summary>
 /// Gets a value indicating whether the message's payload was sent compressed,
 /// as indicated in the message's headers.
 /// </summary>
 /// <param name="receiverMessage">The source <see cref="IReceiverMessage"/> object.</param>
 /// <returns>Whether the message's payload was sent compressed.</returns>
 public static bool IsCompressed(this IReceiverMessage receiverMessage) =>
 receiverMessage.GetHeaders()
 .TryGetValue(HeaderNames.IsCompressedPayload, out bool isCompressed) &&
 isCompressed;
コード例 #2
0
 /// <summary>
 /// Gets the originating system of the message, or null if not found in the
 /// message's headers.
 /// </summary>
 /// <param name="receiverMessage">The source <see cref="IReceiverMessage"/> object.</param>
 /// <returns>The originating system of the message.</returns>
 public static string GetOriginatingSystem(this IReceiverMessage receiverMessage) =>
 receiverMessage.GetHeaders()
 .TryGetValue(HeaderNames.OriginatingSystem, out string originatingSystem)
             ? originatingSystem
             : null;
コード例 #3
0
 /// <summary>
 /// Gets the ID of the message, or null if not found in the message's headers.
 /// </summary>
 /// <param name="receiverMessage">The source <see cref="IReceiverMessage"/> object.</param>
 /// <returns>The ID of the message.</returns>
 public static string GetMessageId(this IReceiverMessage receiverMessage) =>
 receiverMessage.GetHeaders()
 .TryGetValue(HeaderNames.MessageId, out string messageId)
             ? messageId
             : null;
コード例 #4
0
 /// <summary>
 /// Gets a value indicating whether the original message was constructed with
 /// a byte array, as indicated in the message's headers. A value of false
 /// means that the original message was constructed with a string.
 /// </summary>
 /// <param name="receiverMessage">The source <see cref="IReceiverMessage"/> object.</param>
 /// <returns>Whether the original message was constructed with a byte array.</returns>
 public static bool IsBinary(this IReceiverMessage receiverMessage) =>
 receiverMessage.GetHeaders()
 .TryGetValue(HeaderNames.IsBinaryPayload, out bool isBinary) &&
 isBinary;