简体   繁体   English

如何使用 Firebase 模拟器通过 Firestore 触发器测试 Java 云功能?

[英]How to use Firebase emulator to test Java cloud functions with Firestore trigger?

I'm trying to use Java11 runtime for Google cloud/firebase functions, which was quite recently released.我正在尝试将 Java11 运行时用于最近发布的 Google 云/firebase 功能。 I want to test firestore trigger functions on my local machine.我想在我的本地机器上测试 firestore 触发器功能。 Guides on the internet seem to be using the command firebase functions:shell which by itself starts the required emulation processes.互联网上的指南似乎使用命令 firebase 功能:shell 本身启动所需的仿真过程。 However, I don't find any method to specify the.jar file for the firebase functions:shell command.但是,我没有找到任何方法为 firebase 函数指定 .jar 文件:shell 命令。 Or any way to specify the functions.或任何指定功能的方式。 I know it doesn't load my Java http function because it shows the loaded functions and helloWorld isn't one of them:我知道它不会加载我的 Java http function 因为它显示了加载的函数,而 helloWorld 不是其中之一:

gintas-mac:functions gintas$ firebase functions:shell
⚠  Your requested "node" version "10" doesn't match your global version "8"
i  functions: Loaded functions: helloWorld
⚠  functions: The following emulators are not running, calls to these services will affect production: firestore, database, pubsub

It's not possible to use the Firebase CLI to test a function written in Java.无法使用 Firebase CLI 来测试用 Java 编写的 function。 Firebase only supports functions written with the firebase-functions module on nodejs. Firebase 仅支持在 nodejs 上使用 firebase-functions 模块编写的函数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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