Questions tagged [spring-cloud-function]

Use this tag for questions related to the Spring Cloud Function project

Spring Cloud Function is a project in a Spring Cloud portfolio of projects with the following high-level goals:

  • Promote the implementation of business logic via java.util.function.(Supplier, Function, Consumer)
  • Provide necessary deployment and runtime abstractions to ensure the same code can run in multiple environments (e.g., a web endpoint, a stream processor, or a task).
  • Support a uniform programming model across serverless providers, as well as the ability to run standalone (locally or in a PaaS).
  • Enable Spring Boot features (auto-configuration, dependency injection, metrics) on serverless providers.

Resources

See Also

255 questions
0
votes
1 answer

Spring Cloud Stream - unable to serialize java class (works for java record)

Hi I am having an issue with new functional spring cloud stream... I have a basic example: @Autowired private StreamBridge streamBridge; @PostMapping("/publish/{topic}") // fails public boolean publish(@RequestBody MessageClass msg,…
0
votes
1 answer

Spring Cloud Function - how to pass multiple parameters to a function call in Kotlin

In the documentation for Spring Cloud Function, the examples for Kotlin consist of function that takes a single parameter, e.g. @Bean open fun lower(): (String) -> String = { it.lowercase() } which is called via a URL that has the single parameter…
PaulNUK
  • 4,774
  • 2
  • 30
  • 58
0
votes
0 answers

Handle partially failed batch with spring cloud streams

When using spring-cloud-stream for streaming application (functional style) with batches, is there a way to retry/DLQ a failed message but also process (stream) the non-failing records? for example: function received batch of 10 records, and…
0
votes
1 answer

How to log around Spring Cloud Stream functions?

I have a simple Spring cloud Stream function package com.example @Configuration public class Processor { @Bean public Function, Message> mapper() { return msg -> { // do stuff }; …
0
votes
0 answers

AWS adaptor with Spring Cloud function - payload body is removed

I am building a AWS lambda function using Spring cloud, aws adapter and spring native. The lambda is fronted by a APIGateway HTTP API V2.0. 11 2021.0.2
Vasco
  • 782
  • 1
  • 5
  • 22
0
votes
1 answer

spring function in aws lambda not sending back status code

I had the following code working and returning a statusCode. final APIGatewayProxyResponseEvent responseEvent = new APIGatewayProxyResponseEvent(); responseEvent.setHeaders(Map.of(CONTENT_TYPE, APPLICATION_JSON)); …
user1555190
  • 2,803
  • 8
  • 47
  • 80
0
votes
1 answer

spring-cloud-stream dependency upgrade not updating child dependencies

I have update the dependency spring-cloud-stream to resolve the vulnerability issues in spring-cloud-function-context which is the child compile dependency of: org.springframework.cloud
0
votes
0 answers

Spring Cloud Routing Function and SPEL Expression injection - CVE-2022-22963

I am having a springboot application and my local maven repository is having spring cloud dependencies present in it. I understand that for someone to use the CVE-2022-22963 vulnerability, the code should written to use the Spring Cloud routing…
0
votes
2 answers

How to get Context for logging when using APIGatewayProxyRequestEvent in aws-lambda

My project is written in spring-cloud-function and deployed in aws-lambda. I have a requirement wherein I am supposed to log the events. A little search told me to use com.amazonaws.services.lambda.runtime.Context for logging by doing…
Rahul
  • 91
  • 1
  • 11
0
votes
0 answers

Spring cloud function - accept query parameter and header

I have been reading about lambda and spring cloud functions, is there anyway to get hold of query parameters and the headers in the lambda. I created a function, but Message is not holding the query parameter however i see the…
nbenjamin
  • 1
  • 1
0
votes
1 answer

custom exception message in spring cloud function deployed in aws-lambda

I have a java project written using spring-cloud-function and deployed in aws-lambda. I am trying to return a custom exception with some fields in the exception message body, something like" { reason: code:
Rahul
  • 91
  • 1
  • 11
0
votes
2 answers

How to get path parameter in spring cloud function

I have a java application written using spring-cloud-functions and deployed in aws lambda which connects to aws api-gateway I have a 'GET' api(let's say /employees/{employeeId}) which takes an input parameter({employeeId} in this case) and returns…
0
votes
1 answer

GCP Cloud Functions with spring cloud function and spring native

I have been trying to deploy a GCP cloud function using Spring Cloud Function and Spring Native unfortunately it seems that GCP is blocking the AOT mode as shown in the photo "AOT mode disabled" Does anyone had success deploying a native spring…
0
votes
0 answers

Deserializing a json to an abstract class in spring cloud functions

I have a java project written using spring cloud functions and deployed in aws lambda. I have a scenario wherein I have an abstract class extended by 3 other classes. The function catering to the requests receives a request in a json format. The…
0
votes
2 answers

java.lang.ClassCastException: class org.eclipse.jetty.server.Request$1 in Spring Cloud Function

Sample repo available on Github. Given this simple Spring Cloud Function application: @SpringBootApplication class SpringServerlessGcpApplication{ private val random = SecureRandom() @Bean fun uppercase(): (String) -> String = {…
codependent
  • 23,193
  • 31
  • 166
  • 308