Merge branch '4.1.x' of github.com:spring-cloud/spring-cloud-function into 4.1.x
This commit is contained in:
2
.github/dco.yml
vendored
Normal file
2
.github/dco.yml
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
require:
|
||||
members: false
|
||||
28
README.adoc
28
README.adoc
@@ -31,15 +31,11 @@ tracker for issues and merging pull requests into main. If you want
|
||||
to contribute even something trivial please do not hesitate, but
|
||||
follow the guidelines below.
|
||||
|
||||
[[sign-the-contributor-license-agreement]]
|
||||
== Sign the Contributor License Agreement
|
||||
[[developer-certificate-of-origin]]
|
||||
== Developer Certificate of Origin (DCO)
|
||||
|
||||
Before we accept a non-trivial patch or pull request we will need you to sign the
|
||||
https://cla.pivotal.io/sign/spring[Contributor License Agreement].
|
||||
Signing the contributor's agreement does not grant anyone commit rights to the main
|
||||
repository, but it does mean that we can accept your contributions, and you will get an
|
||||
author credit if we do. Active contributors might be asked to join the core team, and
|
||||
given the ability to merge pull requests.
|
||||
All commits must include a __Signed-off-by__ trailer at the end of each commit message to indicate that the contributor agrees to the Developer Certificate of Origin.
|
||||
For additional details, please refer to the blog post https://spring.io/blog/2025/01/06/hello-dco-goodbye-cla-simplifying-contributions-to-spring[Hello DCO, Goodbye CLA: Simplifying Contributions to Spring].
|
||||
|
||||
[[code-of-conduct]]
|
||||
== Code of Conduct
|
||||
@@ -219,7 +215,7 @@ Spring Cloud Build brings along the `basepom:duplicate-finder-maven-plugin`, th
|
||||
[[duplicate-finder-configuration]]
|
||||
=== Duplicate Finder configuration
|
||||
|
||||
Duplicate finder is *enabled by default* and will run in the `verify` phase of your Maven build, but it will only take effect in your project if you add the `duplicate-finder-maven-plugin` to the `build` section of the projecst's `pom.xml`.
|
||||
Duplicate finder is *enabled by default* and will run in the `verify` phase of your Maven build, but it will only take effect in your project if you add the `duplicate-finder-maven-plugin` to the `build` section of the project's `pom.xml`.
|
||||
|
||||
.pom.xml
|
||||
[source,xml]
|
||||
@@ -276,15 +272,11 @@ tracker for issues and merging pull requests into main. If you want
|
||||
to contribute even something trivial please do not hesitate, but
|
||||
follow the guidelines below.
|
||||
|
||||
[[sign-the-contributor-license-agreement]]
|
||||
== Sign the Contributor License Agreement
|
||||
[[developer-certificate-of-origin]]
|
||||
== Developer Certificate of Origin (DCO)
|
||||
|
||||
Before we accept a non-trivial patch or pull request we will need you to sign the
|
||||
https://cla.pivotal.io/sign/spring[Contributor License Agreement].
|
||||
Signing the contributor's agreement does not grant anyone commit rights to the main
|
||||
repository, but it does mean that we can accept your contributions, and you will get an
|
||||
author credit if we do. Active contributors might be asked to join the core team, and
|
||||
given the ability to merge pull requests.
|
||||
All commits must include a __Signed-off-by__ trailer at the end of each commit message to indicate that the contributor agrees to the Developer Certificate of Origin.
|
||||
For additional details, please refer to the blog post https://spring.io/blog/2025/01/06/hello-dco-goodbye-cla-simplifying-contributions-to-spring[Hello DCO, Goodbye CLA: Simplifying Contributions to Spring].
|
||||
|
||||
[[code-of-conduct]]
|
||||
== Code of Conduct
|
||||
@@ -464,7 +456,7 @@ Spring Cloud Build brings along the `basepom:duplicate-finder-maven-plugin`, th
|
||||
[[duplicate-finder-configuration]]
|
||||
=== Duplicate Finder configuration
|
||||
|
||||
Duplicate finder is *enabled by default* and will run in the `verify` phase of your Maven build, but it will only take effect in your project if you add the `duplicate-finder-maven-plugin` to the `build` section of the projecst's `pom.xml`.
|
||||
Duplicate finder is *enabled by default* and will run in the `verify` phase of your Maven build, but it will only take effect in your project if you add the `duplicate-finder-maven-plugin` to the `build` section of the project's `pom.xml`.
|
||||
|
||||
.pom.xml
|
||||
[source,xml]
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-function-parent</artifactId>
|
||||
<version>4.1.4-SNAPSHOT</version>
|
||||
<version>4.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
<packaging>jar</packaging>
|
||||
<name>Spring Cloud Function Docs</name>
|
||||
|
||||
4
pom.xml
4
pom.xml
@@ -6,13 +6,13 @@
|
||||
|
||||
<artifactId>spring-cloud-function-parent</artifactId>
|
||||
<name>Spring Cloud Function Parent</name>
|
||||
<version>4.1.4-SNAPSHOT</version>
|
||||
<version>4.1.6-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-build</artifactId>
|
||||
<version>4.1.4-SNAPSHOT</version>
|
||||
<version>4.1.6-SNAPSHOT</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-function-parent</artifactId>
|
||||
<version>4.1.4-SNAPSHOT</version>
|
||||
<version>4.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<name>spring-cloud-function-adapter-parent</name>
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-function-adapter-parent</artifactId>
|
||||
<version>4.1.4-SNAPSHOT</version>
|
||||
<version>4.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<aws-lambda-events.version>3.11.4</aws-lambda-events.version>
|
||||
<aws-lambda-events.version>3.14.0</aws-lambda-events.version>
|
||||
<aws-java-sdk.version>1.12.29</aws-java-sdk.version>
|
||||
<aws-lambda-java-log4j.version>1.0.1</aws-lambda-java-log4j.version>
|
||||
<aws-lambda-java-serialization.version>1.1.5</aws-lambda-java-serialization.version>
|
||||
|
||||
@@ -17,11 +17,14 @@
|
||||
package org.springframework.cloud.function.adapter.aws;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import com.amazonaws.services.lambda.runtime.serialization.PojoSerializer;
|
||||
import com.amazonaws.services.lambda.runtime.serialization.events.LambdaEventSerializers;
|
||||
import com.amazonaws.services.lambda.runtime.serialization.events.serializers.S3EventSerializer;
|
||||
|
||||
import org.springframework.cloud.function.cloudevent.CloudEventMessageUtils;
|
||||
import org.springframework.cloud.function.context.config.JsonMessageConverter;
|
||||
@@ -30,6 +33,7 @@ import org.springframework.lang.Nullable;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageHeaders;
|
||||
import org.springframework.messaging.converter.MessageConverter;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.MimeType;
|
||||
|
||||
/**
|
||||
@@ -44,6 +48,9 @@ class AWSTypesMessageConverter extends JsonMessageConverter {
|
||||
|
||||
private final JsonMapper jsonMapper;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private final AtomicReference<S3EventSerializer> s3EventSerializer = new AtomicReference<>();
|
||||
|
||||
AWSTypesMessageConverter(JsonMapper jsonMapper) {
|
||||
this(jsonMapper, new MimeType("application", "json"), new MimeType(CloudEventMessageUtils.APPLICATION_CLOUDEVENTS.getType(),
|
||||
CloudEventMessageUtils.APPLICATION_CLOUDEVENTS.getSubtype() + "+json"));
|
||||
@@ -75,7 +82,6 @@ class AWSTypesMessageConverter extends JsonMessageConverter {
|
||||
if (message.getPayload().getClass().isAssignableFrom(targetClass)) {
|
||||
return message.getPayload();
|
||||
}
|
||||
|
||||
if (targetClass.getPackage() != null &&
|
||||
targetClass.getPackage().getName().startsWith("com.amazonaws.services.lambda.runtime.events")) {
|
||||
PojoSerializer<?> serializer = LambdaEventSerializers.serializerFor(targetClass, Thread.currentThread().getContextClassLoader());
|
||||
@@ -110,12 +116,23 @@ class AWSTypesMessageConverter extends JsonMessageConverter {
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected Object convertToInternal(Object payload, @Nullable MessageHeaders headers,
|
||||
@Nullable Object conversionHint) {
|
||||
if (payload instanceof String && headers.containsKey(AWSLambdaUtils.IS_BASE64_ENCODED) && (boolean) headers.get(AWSLambdaUtils.IS_BASE64_ENCODED)) {
|
||||
return ((String) payload).getBytes(StandardCharsets.UTF_8);
|
||||
}
|
||||
if (payload.getClass().getName().equals("com.amazonaws.services.lambda.runtime.events.S3Event")) {
|
||||
if (this.s3EventSerializer.get() == null) {
|
||||
this.s3EventSerializer.set(new S3EventSerializer<>().withClassLoader(ClassUtils.getDefaultClassLoader()));
|
||||
}
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
this.s3EventSerializer.get().toJson(payload, stream);
|
||||
return stream.toByteArray();
|
||||
}
|
||||
|
||||
|
||||
return jsonMapper.toJson(payload);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,10 +28,14 @@ import java.util.Map;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import com.amazonaws.services.lambda.runtime.ClientContext;
|
||||
import com.amazonaws.services.lambda.runtime.CognitoIdentity;
|
||||
import com.amazonaws.services.lambda.runtime.Context;
|
||||
import com.amazonaws.services.lambda.runtime.LambdaLogger;
|
||||
import com.amazonaws.services.lambda.runtime.LambdaRuntime;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
|
||||
import org.springframework.cloud.function.context.FunctionCatalog;
|
||||
import org.springframework.cloud.function.context.catalog.SimpleFunctionRegistry.FunctionInvocationWrapper;
|
||||
import org.springframework.cloud.function.context.config.RoutingFunction;
|
||||
@@ -130,6 +134,8 @@ public final class CustomRuntimeEventLoop implements SmartLifecycle {
|
||||
logger.debug("Attempting to get new event");
|
||||
ResponseEntity<String> response = this.pollForData(rest, requestEntity);
|
||||
|
||||
Context clientContext = generateClientContext(response.getHeaders());
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("New Event received: " + response);
|
||||
}
|
||||
@@ -140,9 +146,9 @@ public final class CustomRuntimeEventLoop implements SmartLifecycle {
|
||||
FunctionInvocationWrapper function = locateFunction(environment, functionCatalog, response.getHeaders());
|
||||
|
||||
ByteArrayInputStream is = new ByteArrayInputStream(response.getBody().getBytes(StandardCharsets.UTF_8));
|
||||
Message<?> requestMessage = AWSLambdaUtils.generateMessage(is, function.getInputType(), function.isSupplier(), mapper, null);
|
||||
|
||||
Message<?> requestMessage = AWSLambdaUtils.generateMessage(is, function.getInputType(), function.isSupplier(), mapper, clientContext);
|
||||
Object functionResponse = function.apply(requestMessage);
|
||||
|
||||
byte[] responseBytes = AWSLambdaUtils.generateOutputFromObject(requestMessage, functionResponse, mapper, function.getOutputType());
|
||||
|
||||
String invocationUrl = MessageFormat
|
||||
@@ -157,12 +163,91 @@ public final class CustomRuntimeEventLoop implements SmartLifecycle {
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
this.propagateAwsError(requestId, e, mapper, runtimeApi, rest);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Context generateClientContext(HttpHeaders headers) {
|
||||
|
||||
Map<String, String> environment = System.getenv();
|
||||
|
||||
Context context = new Context() {
|
||||
|
||||
@Override
|
||||
public int getRemainingTimeInMillis() {
|
||||
long now = System.currentTimeMillis();
|
||||
if (!headers.containsKey("Lambda-Runtime-Deadline-Ms")) {
|
||||
return 0;
|
||||
}
|
||||
int delta = (int) (Long.parseLong(headers.getFirst("Lambda-Runtime-Deadline-Ms")) - now);
|
||||
return delta > 0 ? delta : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMemoryLimitInMB() {
|
||||
if (!environment.containsKey("AWS_LAMBDA_FUNCTION_MEMORY_SIZE")) {
|
||||
return 128;
|
||||
}
|
||||
return Integer.parseInt(environment.getOrDefault("AWS_LAMBDA_FUNCTION_MEMORY_SIZE", "128"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public LambdaLogger getLogger() {
|
||||
return LambdaRuntime.getLogger();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLogStreamName() {
|
||||
return environment.get("LOG_STREAM_NAME");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLogGroupName() {
|
||||
return environment.get("LOG_GROUP_NAME");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInvokedFunctionArn() {
|
||||
return headers.getFirst("Lambda-Runtime-Invoked-Function-Arn");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CognitoIdentity getIdentity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFunctionVersion() {
|
||||
return environment.get("FUNCTION_VERSION");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFunctionName() {
|
||||
return environment.get("FUNCTION_NAME");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClientContext getClientContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAwsRequestId() {
|
||||
return headers.getFirst("Lambda-Runtime-Aws-Request-Id");
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "FUNCTION NAME: " + getFunctionName() + ", FUNCTION VERSION: " + getFunctionVersion()
|
||||
+ ", FUNCTION ARN: " + getInvokedFunctionArn() + ", FUNCTION MEM LIMIT: " + getMemoryLimitInMB()
|
||||
+ ", FUNCTION DEADLINE: " + getRemainingTimeInMillis();
|
||||
}
|
||||
};
|
||||
return context;
|
||||
}
|
||||
|
||||
private void propagateAwsError(String requestId, Exception e, JsonMapper mapper, String runtimeApi, RestTemplate rest) {
|
||||
String errorMessage = e.getMessage();
|
||||
String errorType = e.getClass().getSimpleName();
|
||||
|
||||
@@ -999,6 +999,18 @@ public class FunctionInvokerTests {
|
||||
assertThat(result).contains("s3SchemaVersion");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testS3EventAsOutput() throws Exception {
|
||||
System.setProperty("MAIN_CLASS", S3Configuration.class.getName());
|
||||
System.setProperty("spring.cloud.function.definition", "outputS3Event");
|
||||
FunctionInvoker invoker = new FunctionInvoker();
|
||||
|
||||
InputStream targetStream = new ByteArrayInputStream(this.s3Event.getBytes());
|
||||
ByteArrayOutputStream output = new ByteArrayOutputStream();
|
||||
invoker.handleRequest(targetStream, output, null);
|
||||
assertThat(output.toByteArray()).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testS3Event() throws Exception {
|
||||
System.setProperty("MAIN_CLASS", S3Configuration.class.getName());
|
||||
@@ -1679,6 +1691,13 @@ public class FunctionInvokerTests {
|
||||
@EnableAutoConfiguration
|
||||
@Configuration
|
||||
public static class S3Configuration {
|
||||
|
||||
@Bean
|
||||
public Function<S3Event, S3Event> outputS3Event() {
|
||||
return v -> {
|
||||
return v;
|
||||
};
|
||||
}
|
||||
@Bean
|
||||
public Function<String, String> echoString() {
|
||||
return v -> v;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-function-adapter-parent</artifactId>
|
||||
<version>4.1.4-SNAPSHOT</version>
|
||||
<version>4.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-function-adapter-parent</artifactId>
|
||||
<version>4.1.4-SNAPSHOT</version>
|
||||
<version>4.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<parent>
|
||||
<artifactId>spring-cloud-function-adapter-parent</artifactId>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<version>4.1.4-SNAPSHOT</version>
|
||||
<version>4.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud.function.aws-lambda.packaging</groupId>
|
||||
<artifactId>spring-cloud-function-aws-gradle-parent</artifactId>
|
||||
<version>4.1.4-SNAPSHOT</version>
|
||||
<version>4.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
<properties>
|
||||
<main.basedir>${basedir}/../..</main.basedir>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud.function.aws-lambda.packaging</groupId>
|
||||
<artifactId>spring-cloud-function-aws-gradle-parent</artifactId>
|
||||
<version>4.1.4-SNAPSHOT</version>
|
||||
<version>4.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-function-adapter-parent</artifactId>
|
||||
<version>4.1.4-SNAPSHOT</version>
|
||||
<version>4.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>spring-cloud-function-grpc-cloudevent-ext</artifactId>
|
||||
<name>spring-cloud-function-grpc-cloudevent-ext</name>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-function-adapter-parent</artifactId>
|
||||
<version>4.1.4-SNAPSHOT</version>
|
||||
<version>4.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
<properties>
|
||||
<grpc.version>1.55.1</grpc.version>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-function-adapter-parent</artifactId>
|
||||
<version>4.1.4-SNAPSHOT</version>
|
||||
<version>4.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
@@ -59,7 +59,6 @@
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-function-parent</artifactId>
|
||||
<version>4.1.4-SNAPSHOT</version>
|
||||
<version>4.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
@@ -65,6 +65,10 @@
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-joda</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
|
||||
@@ -21,21 +21,22 @@ import org.springframework.messaging.Message;
|
||||
|
||||
/**
|
||||
* Java-based strategy to assist with determining the name of the route-to function definition.
|
||||
* Once implementation is registered as a bean in application context
|
||||
* Once an implementation is registered as a bean in application context
|
||||
* it will be picked up by the {@link RoutingFunction}.
|
||||
*
|
||||
* <p/>
|
||||
* While {@link RoutingFunction} provides several mechanisms to determine the route-to function definition
|
||||
* this callback takes precedence over all of them.
|
||||
*
|
||||
* @author Oleg Zhurakousky
|
||||
* @author John Blum
|
||||
* @since 3.1
|
||||
*/
|
||||
public interface MessageRoutingCallback {
|
||||
|
||||
/**
|
||||
* Computes and returns the instance of {@link String} which encapsulates,
|
||||
* at the very minimum, function definition.
|
||||
* <br><br>
|
||||
* Computes and returns an instance of {@link String}, which encapsulates,
|
||||
* at the very minimum, a function definition.
|
||||
* <p/>
|
||||
* Providing such message is primarily an optimization feature. It could be useful for cases
|
||||
* where routing procedure is complex and results in, let's say, conversion of the payload to
|
||||
* the target type, which would effectively be thrown away if the ability to modify the target
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2022 the original author or authors.
|
||||
* Copyright 2019-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -63,6 +63,7 @@ import org.springframework.util.StringUtils;
|
||||
*
|
||||
* @author Oleg Zhurakousky
|
||||
* @author Andrey Shlykov
|
||||
* @author Artem Bilan
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
@@ -382,6 +383,12 @@ public final class FunctionTypeUtils {
|
||||
type = FunctionContextUtils.findType(applicationContext.getBeanFactory(), beanDefinitionName);
|
||||
}
|
||||
}
|
||||
else if (type instanceof ParameterizedType) {
|
||||
ResolvableType resolvableType = ResolvableType.forType(type);
|
||||
if (FactoryBean.class.isAssignableFrom(resolvableType.toClass())) {
|
||||
return resolvableType.getGeneric(0).getType();
|
||||
}
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.Module;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import com.fasterxml.jackson.datatype.joda.JodaModule;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import com.google.gson.Gson;
|
||||
import io.cloudevents.spring.messaging.CloudEventMessageConverter;
|
||||
@@ -228,7 +229,7 @@ public class ContextFunctionCatalogAutoConfiguration {
|
||||
mapper = new ObjectMapper();
|
||||
mapper.registerModule(new JavaTimeModule());
|
||||
}
|
||||
|
||||
mapper.registerModule(new JodaModule());
|
||||
if (KotlinDetector.isKotlinPresent()) {
|
||||
try {
|
||||
if (!mapper.getRegisteredModuleIds().contains("com.fasterxml.jackson.module.kotlin.KotlinModule")) {
|
||||
|
||||
@@ -45,10 +45,11 @@ import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* An implementation of Function which acts as a gateway/router by actually
|
||||
* An implementation of {@link Function} which acts as a gateway/router by actually
|
||||
* delegating incoming invocation to a function specified .. .
|
||||
*
|
||||
* @author Oleg Zhurakousky
|
||||
* @author John Blum
|
||||
* @since 2.1
|
||||
*
|
||||
*/
|
||||
@@ -127,8 +128,7 @@ public class RoutingFunction implements Function<Object, Object> {
|
||||
private Object route(Object input, boolean originalInputIsPublisher) {
|
||||
FunctionInvocationWrapper function = null;
|
||||
|
||||
if (input instanceof Message) {
|
||||
Message<?> message = (Message<?>) input;
|
||||
if (input instanceof Message<?> message) {
|
||||
if (this.routingCallback != null) {
|
||||
String functionDefinition = this.routingCallback.routingResult(message);
|
||||
if (StringUtils.hasText(functionDefinition)) {
|
||||
@@ -155,7 +155,7 @@ public class RoutingFunction implements Function<Object, Object> {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (input instanceof Publisher) {
|
||||
else if (input instanceof Publisher<?> publisher) {
|
||||
if (StringUtils.hasText(functionProperties.getDefinition())) {
|
||||
function = functionFromDefinition(functionProperties.getDefinition());
|
||||
}
|
||||
@@ -163,9 +163,9 @@ public class RoutingFunction implements Function<Object, Object> {
|
||||
function = this.functionFromExpression(functionProperties.getRoutingExpression(), input);
|
||||
}
|
||||
else {
|
||||
return input instanceof Mono
|
||||
? Mono.from((Publisher<?>) input).map(v -> route(v, originalInputIsPublisher))
|
||||
: Flux.from((Publisher<?>) input).map(v -> route(v, originalInputIsPublisher));
|
||||
return input instanceof Mono<?> mono
|
||||
? Mono.from(mono).map(v -> route(v, originalInputIsPublisher))
|
||||
: Flux.from(publisher).map(v -> route(v, originalInputIsPublisher));
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -184,7 +184,7 @@ public class RoutingFunction implements Function<Object, Object> {
|
||||
}
|
||||
}
|
||||
|
||||
if (function.getTarget().equals(this)) {
|
||||
if (this.equals(function.getTarget())) {
|
||||
throw new IllegalStateException("Failed to establish route, and routing to itself is not allowed as it creates a loop. Please provide: "
|
||||
+ "'spring.cloud.function.definition' as Message header or as application property or "
|
||||
+ "'spring.cloud.function.routing-expression' as application property.");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2021 the original author or authors.
|
||||
* Copyright 2019-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -54,6 +54,7 @@ import reactor.util.function.Tuple2;
|
||||
import reactor.util.function.Tuple3;
|
||||
import reactor.util.function.Tuples;
|
||||
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
@@ -85,6 +86,7 @@ import static org.junit.jupiter.api.Assertions.fail;
|
||||
/**
|
||||
*
|
||||
* @author Oleg Zhurakousky
|
||||
* @author Artem Bilan
|
||||
*
|
||||
*/
|
||||
public class BeanFactoryAwareFunctionRegistryTests {
|
||||
@@ -895,6 +897,14 @@ public class BeanFactoryAwareFunctionRegistryTests {
|
||||
assertThat(result.size()).isEqualTo(3);
|
||||
}
|
||||
|
||||
@Test
|
||||
void functionFromFactoryBeanIsProperlyResolved() {
|
||||
FunctionCatalog catalog = configureCatalog();
|
||||
Function<Number, String> numberToStringFactoryBean = catalog.lookup("numberToStringFactoryBean");
|
||||
assertThat(numberToStringFactoryBean).isNotNull();
|
||||
assertThat(numberToStringFactoryBean.apply(1)).isEqualTo("1");
|
||||
}
|
||||
|
||||
@Test
|
||||
// see GH-707
|
||||
public void testConcurrencyOnLookup() throws Exception {
|
||||
@@ -1346,6 +1356,23 @@ public class BeanFactoryAwareFunctionRegistryTests {
|
||||
public Consumer<Flux<Person>> reactivePojoConsumer() {
|
||||
return flux -> flux.subscribe(v -> consumerInputRef.set(v));
|
||||
}
|
||||
|
||||
@Bean
|
||||
FactoryBean<Function<Number, String>> numberToStringFactoryBean() {
|
||||
return new FactoryBean<>() {
|
||||
|
||||
@Override
|
||||
public Function<Number, String> getObject() {
|
||||
return Number::toString;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getObjectType() {
|
||||
return Function.class;
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@EnableAutoConfiguration
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-function-parent</artifactId>
|
||||
<version>4.1.4-SNAPSHOT</version>
|
||||
<version>4.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -21,13 +21,22 @@ package org.springframework.cloud.function.core;
|
||||
/**
|
||||
*
|
||||
* @author Oleg Zhurakousky
|
||||
* @author John Blum
|
||||
* @since 3.1
|
||||
*
|
||||
*/
|
||||
public interface FunctionInvocationHelper<I> {
|
||||
|
||||
default boolean isRetainOuputAsMessage(I input) {
|
||||
default boolean isRetainOutputAsMessage(I input) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #isRetainOutputAsMessage(I)}
|
||||
*/
|
||||
@Deprecated
|
||||
default boolean isRetainOuputAsMessage(I input) {
|
||||
return isRetainOutputAsMessage(input);
|
||||
};
|
||||
|
||||
default I preProcessInput(I input, Object inputConverter) {
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
<parent>
|
||||
<artifactId>spring-cloud-dependencies-parent</artifactId>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<version>4.1.4-SNAPSHOT</version>
|
||||
<version>4.1.6-SNAPSHOT</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
<artifactId>spring-cloud-function-dependencies</artifactId>
|
||||
<version>4.1.4-SNAPSHOT</version>
|
||||
<version>4.1.6-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Spring Cloud Function Dependencies</name>
|
||||
<description>Spring Cloud Function Dependencies</description>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-function-parent</artifactId>
|
||||
<version>4.1.4-SNAPSHOT</version>
|
||||
<version>4.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
<spring-cloud-function.version>4.1.4-SNAPSHOT</spring-cloud-function.version>
|
||||
<spring-cloud-function.version>4.1.6-SNAPSHOT</spring-cloud-function.version>
|
||||
<wrapper.version>1.0.27.RELEASE</wrapper.version>
|
||||
</properties>
|
||||
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
<spring-cloud-function.version>4.1.4-SNAPSHOT</spring-cloud-function.version>
|
||||
<spring-cloud-function.version>4.1.6-SNAPSHOT</spring-cloud-function.version>
|
||||
<wrapper.version>1.0.27.RELEASE</wrapper.version>
|
||||
</properties>
|
||||
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
<spring-cloud-function.version>4.1.4-SNAPSHOT</spring-cloud-function.version>
|
||||
<spring-cloud-function.version>4.1.6-SNAPSHOT</spring-cloud-function.version>
|
||||
<wrapper.version>1.0.27.RELEASE</wrapper.version>
|
||||
</properties>
|
||||
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
<spring-cloud-function.version>4.1.4-SNAPSHOT</spring-cloud-function.version>
|
||||
<spring-cloud-function.version>4.1.6-SNAPSHOT</spring-cloud-function.version>
|
||||
<wrapper.version>1.0.27.RELEASE</wrapper.version>
|
||||
</properties>
|
||||
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
<spring-cloud-function.version>4.1.4-SNAPSHOT</spring-cloud-function.version>
|
||||
<spring-cloud-function.version>4.1.6-SNAPSHOT</spring-cloud-function.version>
|
||||
<wrapper.version>1.0.27.RELEASE</wrapper.version>
|
||||
</properties>
|
||||
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
<spring-cloud-function.version>4.1.4-SNAPSHOT</spring-cloud-function.version>
|
||||
<spring-cloud-function.version>4.1.6-SNAPSHOT</spring-cloud-function.version>
|
||||
<wrapper.version>1.0.27.RELEASE</wrapper.version>
|
||||
</properties>
|
||||
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
<spring-cloud-function.version>4.1.4-SNAPSHOT</spring-cloud-function.version>
|
||||
<spring-cloud-function.version>4.1.6-SNAPSHOT</spring-cloud-function.version>
|
||||
<wrapper.version>1.0.27.RELEASE</wrapper.version>
|
||||
</properties>
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<parent>
|
||||
<artifactId>spring-cloud-function-parent</artifactId>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<version>4.1.4-SNAPSHOT</version>
|
||||
<version>4.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-function-parent</artifactId>
|
||||
<version>4.1.4-SNAPSHOT</version>
|
||||
<version>4.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-function-parent</artifactId>
|
||||
<version>4.1.4-SNAPSHOT</version>
|
||||
<version>4.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<wrapper.version>1.0.27.RELEASE</wrapper.version>
|
||||
<aws-lambda-events.version>3.9.0</aws-lambda-events.version>
|
||||
<spring-cloud-function.version>4.1.4-SNAPSHOT</spring-cloud-function.version>
|
||||
<spring-cloud-function.version>4.1.6-SNAPSHOT</spring-cloud-function.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath /> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>io.spring.sample</groupId>
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
<properties>
|
||||
<wrapper.version>1.0.27.RELEASE</wrapper.version>
|
||||
<spring-cloud-function.version>4.1.4-SNAPSHOT</spring-cloud-function.version>
|
||||
<spring-cloud-function.version>4.1.6-SNAPSHOT</spring-cloud-function.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath /> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>io.spring.sample</groupId>
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
<properties>
|
||||
<wrapper.version>1.0.27.RELEASE</wrapper.version>
|
||||
<spring-cloud-function.version>4.1.4-SNAPSHOT</spring-cloud-function.version>
|
||||
<spring-cloud-function.version>4.1.6-SNAPSHOT</spring-cloud-function.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -42,7 +42,11 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.amazonaws</groupId>
|
||||
<artifactId>aws-lambda-java-core</artifactId>
|
||||
<version>1.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>oz.native.sample</groupId>
|
||||
@@ -15,7 +15,7 @@
|
||||
<description>Sample of AWS with Spring Native</description>
|
||||
<properties>
|
||||
<java.version>19</java.version>
|
||||
<spring-cloud.version>2023.0.4-SNAPSHOT</spring-cloud.version><!-- @releaser:version-check-off -->
|
||||
<spring-cloud.version>2023.0.6-SNAPSHOT</spring-cloud.version><!-- @releaser:version-check-off -->
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
@@ -47,7 +47,6 @@
|
||||
<groupId>com.amazonaws</groupId>
|
||||
<artifactId>aws-lambda-java-core</artifactId>
|
||||
<version>1.1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -7,10 +7,14 @@ import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.function.adapter.aws.AWSLambdaUtils;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
// import org.springframework.cloud.function.context.DefaultMessageRoutingHandler;
|
||||
// import org.springframework.cloud.function.context.MessageRoutingCallback;
|
||||
// import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.Message;
|
||||
|
||||
import com.amazonaws.services.lambda.runtime.Context;
|
||||
|
||||
@SpringBootApplication
|
||||
public class NativeFunctionApplication {
|
||||
@@ -33,10 +37,11 @@ public class NativeFunctionApplication {
|
||||
// }
|
||||
|
||||
@Bean
|
||||
public Function<String, String> uppercase() {
|
||||
return v -> {
|
||||
System.out.println("Uppercasing " + v);
|
||||
return v.toUpperCase(Locale.ROOT);
|
||||
public Function<Message<String>, String> uppercase() {
|
||||
return message -> {
|
||||
System.out.println("AWS Context: " + message.getHeaders().get(AWSLambdaUtils.AWS_CONTEXT));
|
||||
System.out.println("Uppercasing " + message.getPayload());
|
||||
return message.getPayload().toUpperCase(Locale.ROOT);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<wrapper.version>1.0.27.RELEASE</wrapper.version>
|
||||
<aws-lambda-events.version>2.0.2</aws-lambda-events.version>
|
||||
<spring-cloud-function.version>4.1.4-SNAPSHOT</spring-cloud-function.version>
|
||||
<spring-cloud-function.version>4.1.6-SNAPSHOT</spring-cloud-function.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath /> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>oz.native.sample</groupId>
|
||||
@@ -16,7 +16,7 @@
|
||||
<description>Sample of AWS with Spring Native</description>
|
||||
<properties>
|
||||
<java.version>21</java.version>
|
||||
<spring-cloud.version>2023.0.4-SNAPSHOT</spring-cloud.version>
|
||||
<spring-cloud.version>2023.0.6-SNAPSHOT</spring-cloud.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<wrapper.version>1.0.29.RELEASE</wrapper.version>
|
||||
<aws-lambda-events.version>3.9.0</aws-lambda-events.version>
|
||||
<spring-cloud-function.version>4.1.4-SNAPSHOT</spring-cloud-function.version>
|
||||
<spring-cloud-function.version>4.1.6-SNAPSHOT</spring-cloud-function.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/>
|
||||
<!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/>
|
||||
<!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/>
|
||||
<!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/>
|
||||
<!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/>
|
||||
<!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<spring-cloud-function.version>4.1.4-SNAPSHOT</spring-cloud-function.version>
|
||||
<spring-cloud-function.version>4.1.6-SNAPSHOT</spring-cloud-function.version>
|
||||
<wrapper.version>1.0.27.RELEASE</wrapper.version>
|
||||
</properties>
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<spring-cloud-function.version>4.1.4-SNAPSHOT</spring-cloud-function.version>
|
||||
<spring-cloud-function.version>4.1.6-SNAPSHOT</spring-cloud-function.version>
|
||||
<wrapper.version>1.0.27.RELEASE</wrapper.version>
|
||||
</properties>
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<spring-cloud-function.version>4.1.4-SNAPSHOT</spring-cloud-function.version>
|
||||
<spring-cloud-function.version>4.1.6-SNAPSHOT</spring-cloud-function.version>
|
||||
<wrapper.version>1.0.27.RELEASE</wrapper.version>
|
||||
</properties>
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<spring-cloud-function.version>4.1.4-SNAPSHOT</spring-cloud-function.version>
|
||||
<spring-cloud-function.version>4.1.6-SNAPSHOT</spring-cloud-function.version>
|
||||
<wrapper.version>1.0.27.RELEASE</wrapper.version>
|
||||
</properties>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<wrapper.version>1.0.27.RELEASE</wrapper.version>
|
||||
<aws-lambda-events.version>2.0.2</aws-lambda-events.version>
|
||||
<spring-cloud-function.version>4.1.4-SNAPSHOT</spring-cloud-function.version>
|
||||
<spring-cloud-function.version>4.1.6-SNAPSHOT</spring-cloud-function.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<spring-cloud-function.version>4.1.4-SNAPSHOT</spring-cloud-function.version>
|
||||
<spring-cloud-function.version>4.1.6-SNAPSHOT</spring-cloud-function.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
<groupId>com.example.grpc</groupId>
|
||||
@@ -16,7 +16,7 @@
|
||||
<name>function-sample-grpc-cloudevent</name>
|
||||
<description>Demo project for Spring Boot</description>
|
||||
<properties>
|
||||
<spring-cloud-function.version>4.1.4-SNAPSHOT</spring-cloud-function.version>
|
||||
<spring-cloud-function.version>4.1.6-SNAPSHOT</spring-cloud-function.version>
|
||||
<grpc.version>1.55.1</grpc.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<reactor.version>3.1.2.RELEASE</reactor.version>
|
||||
<spring-cloud-function.version>4.1.4-SNAPSHOT</spring-cloud-function.version>
|
||||
<spring-cloud-function.version>4.1.6-SNAPSHOT</spring-cloud-function.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<spring-cloud-function.version>4.1.4-SNAPSHOT</spring-cloud-function.version>
|
||||
<spring-cloud-function.version>4.1.6-SNAPSHOT</spring-cloud-function.version>
|
||||
<wrapper.version>1.0.27.RELEASE</wrapper.version>
|
||||
</properties>
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>17</java.version>
|
||||
<spring-cloud-function.version>4.1.4-SNAPSHOT</spring-cloud-function.version>
|
||||
<spring-cloud-function.version>4.1.6-SNAPSHOT</spring-cloud-function.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<spring-cloud-function.version>4.1.4-SNAPSHOT</spring-cloud-function.version>
|
||||
<spring-cloud-function.version>4.1.6-SNAPSHOT</spring-cloud-function.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<spring-cloud-function.version>4.1.4-SNAPSHOT</spring-cloud-function.version>
|
||||
<spring-cloud-function.version>4.1.6-SNAPSHOT</spring-cloud-function.version>
|
||||
<wrapper.version>1.0.27.RELEASE</wrapper.version>
|
||||
</properties>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-function-parent</artifactId>
|
||||
<version>4.1.4-SNAPSHOT</version>
|
||||
<version>4.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>oz.spring</groupId>
|
||||
@@ -15,7 +15,7 @@
|
||||
<description>Template project for creating function that can be deployed as AWS Lambda</description>
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
<spring-cloud.version>2023.0.4-SNAPSHOT</spring-cloud.version>
|
||||
<spring-cloud.version>2023.0.6-SNAPSHOT</spring-cloud.version>
|
||||
<wrapper.version>1.0.31.RELEASE</wrapper.version>
|
||||
<aws-lambda-events.version>3.9.0</aws-lambda-events.version>
|
||||
<aws-lambda-java-core.version>1.1.0</aws-lambda-java-core.version>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.12-SNAPSHOT</version>
|
||||
<version>3.2.12</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>oz.spring</groupId>
|
||||
@@ -15,7 +15,7 @@
|
||||
<description>Template project for creating function that can be deployed as AWS Lambda</description>
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
<spring-cloud.version>2023.0.4-SNAPSHOT</spring-cloud.version>
|
||||
<spring-cloud.version>2023.0.6-SNAPSHOT</spring-cloud.version>
|
||||
<wrapper.version>1.0.31.RELEASE</wrapper.version>
|
||||
<aws-lambda-events.version>3.9.0</aws-lambda-events.version>
|
||||
<aws-lambda-java-core.version>1.1.0</aws-lambda-java-core.version>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-function-parent</artifactId>
|
||||
<version>4.1.4-SNAPSHOT</version>
|
||||
<version>4.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-function-parent</artifactId>
|
||||
<version>4.1.4-SNAPSHOT</version>
|
||||
<version>4.1.6-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>spring-cloud-starter-function-web</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-function-parent</artifactId>
|
||||
<version>4.1.4-SNAPSHOT</version>
|
||||
<version>4.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>spring-cloud-starter-function-webflux</artifactId>
|
||||
<name>spring-cloud-starter-function-webflux</name>
|
||||
|
||||
Reference in New Issue
Block a user