简体   繁体   中英

How can I take data from google cloud pubsub to firebase realtime data base

我需要从google cloud pubsub中获取数据。数据是由IOT设备生成的。每当IOT设备将数据发送到云时,我都需要将数据从pubsub传输到Firebase实时数据库。数据库。我该怎么做。

Take a look at Cloud Functions. They will do exactly what you need for this.

There's a few pieces you'll need to setup and understand about firebase, so checking out a basic tutorial on that first would be a good plan too.

I did a session recently where we built an application on stage, and the Cloud Function that brought our device telemetry over into Firestore (not Firebase RTD, but same concepts in an updated package):

https://github.com/GabeWeiss/GoogleIoTCoreApp/tree/master/gcf/telemetryToFirestore

That's the code for the Cloud Function itself. To understand the concepts around the pieces you're looking at, check out:

https://firebase.google.com/docs/ <-- getting started guides for Firebase (although again, I'd recommend going straight to Firestore)

and

https://cloud.google.com/functions/docs/tutorials/pubsub <-- tutorial for Pub/Sub Cloud Function tutorials.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM