The English version of quarkus.io is the official project site. Translated sites are community supported on a best-effort basis.

Google Cloud Functionsを使用した Funqy HTTP バインディング

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で使用する方法を説明しています。

Funqy HTTP + Google Cloud Functionsのバインディングは、REST over HTTPの代替にはなりません。Funqyは多くの異なるプロトコルや関数プロバイダ間でポータブルである必要があるため、HTTPバインディングは非常にミニマムで、リンクなどのREST機能、キャッシュコントロールや条件付きGETなどのHTTP機能を利用する機能は失われます。代わりに、QuarkusのJakarta REST、Spring MVC、またはVert.x Web Reactive Routeの サポート を使用することを検討するとよいでしょう。これらは、QuarkusとGoogle Cloud Functionsでも使用できます。

追加のクイックスタート

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

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

The solution is located in the funqy-google-cloud-functions-http-quickstart directory.

コード

There is nothing special about the code and more importantly nothing Google Cloud specific. Funqy functions can be deployed to many environments and Google Cloud Functions is one of them. The Java code is actually the same exact code as the 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")

関連コンテンツ