Documentation - Is function .publish() deprecated or not?
See original GitHub issueAll the documentation “quick start” examples are showing usage with .publish()
function.
https://googleapis.dev/nodejs/pubsub/latest/index.html
// Send a message to the topic
topic.publish(Buffer.from('Test message!'));
https://cloud.google.com/pubsub/docs/quickstart-client-libraries
try {
const messageId = await pubSubClient.topic(topicName).publish(dataBuffer);
console.log(`Message ${messageId} published.`);
} catch (error) {
console.error(`Received error while publishing: ${error.message}`);
process.exitCode = 1;
}
However this function is deprecated as per the source code documentation https://github.com/googleapis/nodejs-pubsub/blob/main/src/topic.ts#L635 But this commit has been done 2 years ago? https://github.com/googleapis/nodejs-pubsub/commit/b2f96ffe6c1db93741f40804786f8c294717676b#diff-8533605ceddda0b8f0fcbdc3dc3c443d289c4a50622e5562e069a01e202d8b84R613
At first I thought that the docs are just not updated but than it’s already 2 years? So the question is, are the docs really just not updated and we should rewrite it to publishMessage() to get rid of all the warnings we are getting or is that deprecation warning wrong?
Thanks
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:12 (2 by maintainers)
Top GitHub Comments
@EyePulp
Thanks! I’m gonna work with that 😄
@chronos1nside sorry, to adapt your example: