How to publish message in Google Pub/Sub from Firebase Cloud Function?

后端 未结 1 595
孤城傲影
孤城傲影 2021-01-11 19:12

I wrote a function that receive a http request and send a e-mail. But, I would like receive a http request and send a pub message. The problem is that the documentation is n

相关标签:
1条回答
  • 2021-01-11 19:29

    As I understand, you wish to send a message to Pub/Sub from your Firebase Cloud Functions implementation.

    You can easily use the Node.js Pub/Sub client library, with already defined functionalities, like publish.

    Or, if you prefer, you can build your own client, directly calling the REST API for Google Cloud Pub/Sub. There's also a RPC reference if it suits your needs better.


    You won't need

    information like host, port, id, passwd of broker

    as the mentioned client, or your REST API requests will require authentication .

    0 讨论(0)
提交回复
热议问题