Class Message (2.17.0)
Stay organized with collections
Save and categorize content based on your preferences.
Message objects provide a simple interface for users to get message data and acknowledge the message.
Package
@google-cloud/pubsub!
Constructors
(constructor)(sub, { ackId, message, deliveryAttempt })
constructor(sub: Subscriber, { ackId, message, deliveryAttempt }: google.pubsub.v1.IReceivedMessage);
Constructs a new instance of the Message
class
Parameters
Name | Description |
sub |
Subscriber
The parent subscriber.
|
{ ackId, message, deliveryAttempt } |
google.pubsub.v1.IReceivedMessage
|
Properties
ackId
Property Value
attributes
attributes: {
[key: string]: string;
};
Property Value
Type | Description |
{
[key: string]: string;
} | |
data
Property Value
deliveryAttempt
Property Value
id
Property Value
length
The length of the message data.
{number}
Property Value
orderingKey
Property Value
publishTime
publishTime: PreciseDate;
Property Value
Type | Description |
PreciseDate | |
received
Property Value
Methods
ack()
Acknowledges the message.
Returns
modAck(deadline)
modAck(deadline: number): void;
Modifies the ack deadline.
Parameter
Name | Description |
deadline |
number
The number of seconds to extend the deadline.
|
Returns
nack()
Removes the message from our inventory and schedules it to be redelivered.
Returns
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-05-06 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]