/// <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;
/// <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;
/// <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;
/// <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;