Split from 1425: I also have a few other questions, if someone can help me will really appreciate it #1506
Labels
api: pubsub
Issues related to the googleapis/nodejs-pubsub API.
type: question
Request for information or clarification. Not an issue.
I also have a few other questions, if someone can help me will really appreciate it:
I have been following this guide to publish to a topic and then handle the topic once the cloud function receives it: https://firebase.google.com/docs/functions/pubsub-events
This is how the function that gets triggered when the topic is published is defined:
functions.pubsub.topic('topic-name').onPublish((message) => {
// ...
});
And this is how we publish to a topic:
const topic = pubsub.topic(req.body.topic);
const messageObject = {
data: {
message: req.body.message,
},
};
const messageBuffer = Buffer.from(JSON.stringify(messageObject), 'utf8');
// Publishes a message
try {
await topic.publish(messageBuffer);
res.status(200).send('Message published.');
}
....
My questions are:
"Unless an exception is thrown and automatic retrying is enabled, Cloud Functions acks incoming Pub/Sub messages internally upon function
completion."
Originally posted by @minuhariharan in #1425 (comment)
The text was updated successfully, but these errors were encountered: