You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
spring-cloud: 2024.0.0
spring-cloud-function-context: 4.2.0
After udating to spring-cloud version 2024.0.0 our pojo function class extending an abstract class containing void accept(Message message) is no longer found by FunctionTypeUtils.discoverFunctionalMethod.
Instead the application does not start with following exception:
Caused by: java.lang.IllegalArgumentException: Only Supplier, Function or Consumer supported at the moment. Was class com.cie.sample.events.SampleEventConsumer
at org.springframework.util.Assert.isTrue(Assert.java:116)
Sample
Parent class:
import org.springframework.messaging.Message;
import java.util.function.Consumer;
public abstract class AbstractConsumer<T> implements Consumer<T> {
@Override
public final void accept(Message<T> message) {
if (message == null) {
return;
}
doAccept(message.getPayload());
}
protected abstract void doAccept(T payload);
}
Child
public class SampleEventConsumer extends AbstractConsumer<SampleData> {
@Override
protected void doAccept(SampleData data) {
}
}
Trouble shooting
In spring-cloud version 2023.0.4 FunctionTypeUtils checks if class isAssignableFrom supported functions.
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
spring-cloud: 2024.0.0
spring-cloud-function-context: 4.2.0
After udating to spring-cloud version 2024.0.0 our pojo function class extending an abstract class containing void accept(Message message) is no longer found by FunctionTypeUtils.discoverFunctionalMethod.
Instead the application does not start with following exception:
Sample
Parent class:
Child
Trouble shooting
In spring-cloud version 2023.0.4 FunctionTypeUtils checks if class isAssignableFrom supported functions.
Since spring-cloud: 2024.0.0 FunctionTypeUtils only check if the class == pojoFunctionClass
The change was made in GH-1204 Remove dependency on Typetools
The text was updated successfully, but these errors were encountered: