try upgrading sample version

try upgrading sample version of adapter dependency

Restore GSON mapper preference

default to GSON if impl not specified
This commit is contained in:
dzou
2021-04-30 18:09:37 -04:00
committed by Oleg Zhurakousky
parent d9f2bb4079
commit 1c87e71aa8
2 changed files with 8 additions and 2 deletions

View File

@@ -66,6 +66,12 @@ public class FunctionInvoker extends AbstractSpringFunctionAdapterInitializer<Ht
if (System.getenv().containsKey("spring.cloud.function.definition")) {
this.functionName = System.getenv("spring.cloud.function.definition");
}
// Default to GSON if implementation not specified.
if (!System.getenv().containsKey("spring.http.converters.preferred-json-mapper")) {
System.setProperty("spring.http.converters.preferred-json-mapper", "gson");
}
Thread.currentThread() // TODO: remove after upgrading to 1.0.0-alpha-2-rc5
.setContextClassLoader(FunctionInvoker.class.getClassLoader());
initialize(null);

View File

@@ -23,7 +23,7 @@
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-function-adapter-gcp</artifactId>
<version>3.1.2-SNAPSHOT</version>
<version>3.1.3-SNAPSHOT</version>
</dependency>
<!-- test dependencies -->
@@ -74,7 +74,7 @@
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-function-adapter-gcp</artifactId>
<version>3.1.0-SNAPSHOT</version>
<version>3.1.3-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>