[ Web Proxy ]
URL:
Viewing: https://firebase.google.com/docs/reference/functions/firebase-functions.pubsub.message [Back]  [Original]

pubsub.Message class  |  Cloud Functions for Firebase Skip to main content
Overview Fundamentals AI Build Run Reference Samples
Firebase [Firebase]
Send feedback

pubsub.Message class Stay organized with collections Save and categorize content based on your preferences.

Interface representing a Google Cloud Pub/Sub message.

Signature:

export declare class Message 

Constructors

Constructor Modifiers Description
(constructor)(data) Constructs a new instance of the Message class

Properties

Property Modifiers Type Description
attributes { [key: string]: string; } User-defined attributes published with the message, if any.
data string The data payload of this message object as a base64-encoded string.
json any The JSON data payload of this message object, if any.

Methods

Method Modifiers Description
toJSON() Returns a JSON-serializable representation of this object.

pubsub.Message.(constructor)

Constructs a new instance of the Message class

Signature:

constructor(data: any);

Parameters

Parameter Type Description
data any

pubsub.Message.attributes

User-defined attributes published with the message, if any.

Signature:

readonly attributes: {
        [key: string]: string;
    };

pubsub.Message.data

The data payload of this message object as a base64-encoded string.

Signature:

readonly data: string;

pubsub.Message.json

The JSON data payload of this message object, if any.

Signature:

get json(): any;

pubsub.Message.toJSON()

Returns a JSON-serializable representation of this object.

Signature:

toJSON(): any;

Returns:

any

A JSON-serializable representation of this object.

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 2022-09-13 UTC.

Need to tell us more? [[["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 2022-09-13 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page