Azure / Azure/azure-functions-java-library

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

Offen
#159 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Java
Sterne
45
Forks
49
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Das Issue nennt spring-cloud-function-adapter-azure und zeigt die HelloHandler-Beispiele, identifiziert jedoch keine Repository-Datei oder keinen Test. Beginne damit, den Adapter und den Aufrufpfad der Azure-HTTP-Funktion zu überprüfen, um festzustellen, ob Rückgaben von Mono und Flux unterstützt werden. Done sollte eine klare Machbarkeitsaussage sein, bei der der relevante Implementierungs- oder Dokumentationspfad angegeben ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
azure, java
Bereich
api, backend
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
20/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.