Azure / Azure/azure-functions-java-library

Azure Function coded with spring-cloud-function-adapter-azure SDK cannot return value of form of Mono/Flux.

オープン
#159 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
45
フォーク
49
PR マージ指標
30日以内にマージされた PR はありません

説明

We are using the spring-cloud-function-adapter-azure SDK to build our function.
We expect the return value to be in the form of Mono and Flux, but the we cannot return the corresponding value.

The code link provided by the official website: Getting started with Spring Cloud Function in Azure | Microsoft Docs
After checking the code provided by the official website, we found that only the return value in the HTTP response format was provided as follows:

```
public class HelloHandler extends FunctionInvoker {

@FunctionName("hello")
public HttpResponseMessage execute(
@HttpTrigger(name = "request", methods = {HttpMethod.GET, HttpMethod.POST}, authLevel = AuthorizationLevel.ANONYMOUS) HttpRequestMessage> request,
ExecutionContext context) {
User user = request.getBody()
.filter((u -> u.getName() != null))
.orElseGet(() -> new User(
request.getQueryParameters()
.getOrDefault("name", "world")));
context.getLogger().info("Greeting user name: " + user.getName());
return request
.createResponseBuilder(HttpStatus.OK)
.body(handleRequest(user, context))
.header("Content-Type", "application/json")
.build();
}}
```

I did not find the return form of Mono and Flux. The return format that we wanted is as follows:

```
public class HelloHandler extends FunctionInvoker> {

@FunctionName("hello")
public HttpResponseMessage execute(
@HttpTrigger(name = "request", methods = {HttpMethod.GET, HttpMethod.POST}, authLevel = AuthorizationLevel.ANONYMOUS) HttpRequestMessage> request,
ExecutionContext context) {
// ...
}
```

We want to know whether the return of Mono and Flux is supported on Azure, because the customer found that .NET can return the corresponding value, as follows:

```
[FunctionName("Httpxample")]
public static async Task Run(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HtppREquest req,
Iloogger log
)
```

Please confirm the feasibility of this request. Thank you very much for your help.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

この issue では spring-cloud-function-adapter-azure の名前が挙げられ、HelloHandler の例が示されていますが、リポジトリのファイルやテストは特定されていません。まず adapter と Azure HTTP function の呼び出し経路を確認し、Mono と Flux の戻り値がサポートされているか判断してください。Done では、関連する実装またはドキュメントの経路を特定した、明確な実現可能性の回答を示す必要があります。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
azure, java
領域
api, backend
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
20/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。