public sealed class ReceivedMessage : IMessage<ReceivedMessage>, IEquatable<ReceivedMessage>, IDeepCloneable<ReceivedMessage>, IBufferMessage, IMessage
Reference documentation and code samples for the Cloud Pub/Sub v1 API class ReceivedMessage.
A message and its corresponding acknowledgment ID.
Optional. The approximate number of times that Pub/Sub has attempted to
deliver the associated message to a subscriber.
More precisely, this is 1 + (number of NACKs) +
(number of ack_deadline exceeds) for this message.
A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline
exceeds event is whenever a message is not acknowledged within
ack_deadline. Note that ack_deadline is initially
Subscription.ackDeadlineSeconds, but may get extended automatically by
the client library.
Upon the first delivery of a given message, delivery_attempt will have a
value of 1. The value is calculated at best effort and is approximate.
If a DeadLetterPolicy is not set on the subscription, this will be 0.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis webpage provides reference documentation for the \u003ccode\u003eReceivedMessage\u003c/code\u003e class within the Google Cloud Pub/Sub v1 API for .NET, with versioned links ranging from 2.3.0 to the latest version 3.23.0.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eReceivedMessage\u003c/code\u003e class represents a message and its acknowledgment ID and is implemented with interfaces including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eKey properties of the \u003ccode\u003eReceivedMessage\u003c/code\u003e class include \u003ccode\u003eAckId\u003c/code\u003e (for acknowledging messages), \u003ccode\u003eDeliveryAttempt\u003c/code\u003e (tracking delivery attempts), and \u003ccode\u003eMessage\u003c/code\u003e (containing the \u003ccode\u003ePubsubMessage\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eReceivedMessage\u003c/code\u003e class has two constructors; one is empty and the other takes another \u003ccode\u003eReceivedMessage\u003c/code\u003e as a parameter.\u003c/p\u003e\n"],["\u003cp\u003eThe class inherits members from the base \u003ccode\u003eobject\u003c/code\u003e class such as \u003ccode\u003eGetHashCode\u003c/code\u003e, \u003ccode\u003eGetType\u003c/code\u003e, and \u003ccode\u003eToString\u003c/code\u003e, and it resides in the \u003ccode\u003eGoogle.Cloud.PubSub.V1\u003c/code\u003e namespace, within the \u003ccode\u003eGoogle.Cloud.PubSub.V1.dll\u003c/code\u003e assembly.\u003c/p\u003e\n"]]],[],null,["# Cloud Pub/Sub v1 API - Class ReceivedMessage (3.27.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.27.0 (latest)](/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.26.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.26.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.25.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.25.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.24.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.24.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.23.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.23.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.22.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.22.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.21.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.21.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.20.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.20.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.19.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.19.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.18.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.18.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.17.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.17.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.16.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.16.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.15.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.15.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.14.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.14.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.13.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.13.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.12.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.12.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.11.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.11.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.10.1](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.10.1/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.9.1](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.9.1/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.8.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.7.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.6.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.5.1](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.5.1/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.4.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.3.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.2.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.1.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.0.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [2.10.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/2.10.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [2.9.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/2.9.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [2.8.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/2.8.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [2.7.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/2.7.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [2.6.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/2.6.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/2.5.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/2.4.0/Google.Cloud.PubSub.V1.ReceivedMessage)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/2.3.0/Google.Cloud.PubSub.V1.ReceivedMessage) \n\n public sealed class ReceivedMessage : IMessage\u003cReceivedMessage\u003e, IEquatable\u003cReceivedMessage\u003e, IDeepCloneable\u003cReceivedMessage\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Cloud Pub/Sub v1 API class ReceivedMessage.\n\nA message and its corresponding acknowledgment ID. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e ReceivedMessage \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[ReceivedMessage](/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.ReceivedMessage), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[ReceivedMessage](/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.ReceivedMessage), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[ReceivedMessage](/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.ReceivedMessage), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.PubSub.V1](/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.PubSub.V1.dll\n\nConstructors\n------------\n\n### ReceivedMessage()\n\n public ReceivedMessage()\n\n### ReceivedMessage(ReceivedMessage)\n\n public ReceivedMessage(ReceivedMessage other)\n\nProperties\n----------\n\n### AckId\n\n public string AckId { get; set; }\n\nOptional. This ID can be used to acknowledge the received message.\n\n### DeliveryAttempt\n\n public int DeliveryAttempt { get; set; }\n\nOptional. The approximate number of times that Pub/Sub has attempted to\ndeliver the associated message to a subscriber.\n\nMore precisely, this is 1 + (number of NACKs) +\n(number of ack_deadline exceeds) for this message.\n\nA NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline\nexceeds event is whenever a message is not acknowledged within\nack_deadline. Note that ack_deadline is initially\nSubscription.ackDeadlineSeconds, but may get extended automatically by\nthe client library.\n\nUpon the first delivery of a given message, `delivery_attempt` will have a\nvalue of 1. The value is calculated at best effort and is approximate.\n\nIf a DeadLetterPolicy is not set on the subscription, this will be 0.\n\n### Message\n\n public PubsubMessage Message { get; set; }\n\nOptional. The message."]]