GH-1187 Fix AWS Context initialization for Custom Runtime

Updated sample to show that Context is not null

Resolves #1187
This commit is contained in:
Oleg Zhurakousky
2025-01-13 13:23:15 +01:00
parent a0405d306c
commit 26ef1fa76e
5 changed files with 114 additions and 9 deletions

View File

@@ -31,6 +31,9 @@ import org.springframework.beans.factory.aot.BeanFactoryInitializationAotContrib
import org.springframework.beans.factory.aot.BeanFactoryInitializationAotProcessor;
import org.springframework.beans.factory.aot.BeanFactoryInitializationCode;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.boot.http.client.ClientHttpRequestFactorySettings;
import org.springframework.boot.web.server.Ssl;
import org.springframework.boot.web.server.Ssl.ServerNameSslBundle;
import org.springframework.cloud.function.context.catalog.FunctionTypeUtils;
import org.springframework.cloud.function.context.config.FunctionContextUtils;
import org.springframework.cloud.function.context.message.MessageUtils;
@@ -105,6 +108,15 @@ public class FunctionTypeProcessor implements BeanFactoryInitializationAotProces
// known static types
runtimeHints.reflection().registerType(MessageUtils.MessageStructureWithCaseInsensitiveHeaderKeys.class,
MemberCategory.INVOKE_PUBLIC_METHODS);
// temporary due to bug in boot
runtimeHints.reflection().registerType(ClientHttpRequestFactorySettings.class,
MemberCategory.INVOKE_PUBLIC_METHODS);
runtimeHints.reflection().registerType(Ssl.class,
MemberCategory.INVOKE_PUBLIC_METHODS);
runtimeHints.reflection().registerType(ServerNameSslBundle.class,
MemberCategory.INVOKE_PUBLIC_METHODS);
}
}