Send feedback
Class Message (2.16.6) Stay organized with collections
Save and categorize content based on your preferences.
Version 2.16.6 keyboard_arrow_down
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
data
Property Value
deliveryAttempt
deliveryAttempt
:
number
;
Property Value
id
Property Value
length
The length of the message data.
{number}
Property Value
orderingKey
Property Value
publishTime
publishTime
:
PreciseDate
;
Property Value
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
Send feedback
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 2025-09-04 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,[]]