Skip to content

Commit

Permalink
GH-2820: Component beans and function return types
Browse files Browse the repository at this point in the history
 - When Kafka Streams functions are provided as component beans,
   the function type check in the core Spring Cloud Stream framework,
   fails with an NPE. Addressing this issue.

Resolves #2820
  • Loading branch information
sobychacko committed Sep 29, 2023
1 parent 3a52c3b commit d1a0aff
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1026,11 +1026,15 @@ private String[] filterEligibleFunctionDefinitions() {
if (this.applicationContext.containsBean(functionName)) {
Object functionBean = this.applicationContext.getBean(functionName);
Type functionType = FunctionTypeUtils.discoverFunctionType(functionBean, functionName, (GenericApplicationContext) this.applicationContext);
String functionTypeStringValue = functionType.toString();
if (functionTypeStringValue.contains("KTable") || functionTypeStringValue.contains("KStream")) {
if (functionType == null) {
eligibleDefinition = false;
}

else {
String functionTypeStringValue = functionType.toString();
if (functionTypeStringValue.contains("KTable") || functionTypeStringValue.contains("KStream")) {
eligibleDefinition = false;
}
}
}
else {
logger.warn("You have defined function definition that does not exist: " + functionName);
Expand Down

0 comments on commit d1a0aff

Please sign in to comment.