Azure / Azure/azure-functions-java-library
Azure Function coded with spring-cloud-function-adapter-azure SDK cannot return value of form of Mono/Flux.
- Lingua principale
- Java
- Stelle
- 45
- Fork
- 49
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
L’issue nomina spring-cloud-function-adapter-azure e mostra gli esempi HelloHandler, ma non identifica alcun file del repository né alcun test. Inizia esaminando l’adapter e il percorso di invocazione della funzione HTTP di Azure per determinare se sono supportati i valori restituiti da Mono e Flux. Done deve essere una risposta chiara sulla fattibilità, con l’identificazione del percorso di implementazione o documentazione pertinente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- azure, java
- Ambito
- api, backend
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 20/100