Add Message and MessageConverter to the list of classes loaded by deployer
This commit is contained in:
@@ -5,6 +5,8 @@ import java.util.function.Function;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.support.MessageBuilder;
|
||||
|
||||
@SpringBootApplication
|
||||
public class SimpleFunctionAppApplication {
|
||||
@@ -14,9 +16,13 @@ public class SimpleFunctionAppApplication {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Function<String, String> uppercase() {
|
||||
public Function<Message<String>, Message<String>> uppercase() {
|
||||
System.out.println("==> CREATING 'uppercase' FUNCTION bean");
|
||||
return new UpperCaseFunction();
|
||||
return message -> {
|
||||
UpperCaseFunction func = new UpperCaseFunction();
|
||||
String result = func.apply(message.getPayload());
|
||||
return MessageBuilder.withPayload(result).build();
|
||||
};
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -162,9 +162,13 @@ class FunctionArchiveDeployer extends JarLauncher {
|
||||
|
||||
private boolean shouldLoadViaDeployerLoader(String name) {
|
||||
return name.startsWith("org.reactivestreams")
|
||||
|| name.startsWith("reactor.");
|
||||
|| name.startsWith("reactor.")
|
||||
|| name.startsWith("org.springframework.messaging.Message")
|
||||
|| name.startsWith("org.springframework.messaging.converter.MessageConverter");
|
||||
}
|
||||
|
||||
|
||||
|
||||
private String discoverFunctionClassName(FunctionDeployerProperties functionProperties) {
|
||||
try {
|
||||
return StringUtils.hasText(functionProperties.getFunctionClass())
|
||||
|
||||
Reference in New Issue
Block a user