Funqy HTTP binding with Google Cloud Functions

preview

HTTP クライアントが Google Cloud Function 上で Funqy 関数を呼び出すことができるようにする場合、Quarkus では、1 つの Google Cloud Function としてデプロイされた HTTP を通じて複数の Funqy 関数を公開することができます。なお、このアプローチは、通常の Funqy Google Cloud Function の統合よりもオーバーヘッドが増加します。

この技術は、previewと考えられています。

preview では、下位互換性やエコシステムでの存在は保証されていません。具体的な改善には設定や API の変更が必要になるかもしれませんが、 stable になるための計画は現在進行中です。フィードバックは メーリングリストGitHub の課題管理 で受け付けています。

とりうるステータスの完全なリストについては、 FAQの項目 を参照してください。

Google Cloud Functions Http Guide に従ってください。このガイドでは、FunqyをはじめとするさまざまなHTTPフレームワークをGoogle Cloud Functionsで使用する方法を説明しています。

The Funqy HTTP + Google Cloud Functions binding is not a replacement for REST over HTTP. Because Funqy needs to be portable across a lot of different protocols and function providers its HTTP binding is very minimalistic and you will lose REST features like linking and the ability to leverage HTTP features like cache-control and conditional GETs. You may want to consider using Quarkus’s Jakarta REST, Spring MVC, or Vert.x Web Reactive Route support instead. They also work with Quarkus and Google Cloud Functions.

追加のクイックスタート

Google Cloud Functions HTTP Guide で紹介されているGoogle Cloud Functionsプロジェクトの生成に加え、Google Cloud Functions上でFunqy HTTPを実行するためのクイックスタートも用意されています。

git clone https://github.com/quarkusio/quarkus-quickstarts.git で Git リポジトリーをクローンします。または、https://github.com/quarkusio/quarkus-quickstarts/archive/main.zip[アーカイブ] をダウンロードします。

ソリューションは funqy-google-cloud-functions-http-quickstart ディレクトリ にあります。

コード

コードに特別なものはありませんし、もっと重要なのはGoogle Cloudに特化したものはないということです。Funqy関数は多くの環境にデプロイでき、Google Cloud Functionsもその一つです。Javaコードは実は funqy-http-quickstart と全く同じコードです。

はじめに

このクイックスタートを実行するための手順は、 Google Cloud Functions HTTP Guide で定義されているものと全く同じです。違いは、クイックスタートから実行することと、Maven の依存関係が若干異なることです。

pom.xml
<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-funqy-http</artifactId>
</dependency>
<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-google-cloud-functions-http</artifactId>
</dependency>
build.gradle
implementation("io.quarkus:quarkus-funqy-http")
implementation("io.quarkus:quarkus-google-cloud-functions-http")