Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
4.6.0
-
None
-
Unknown
Description
When setting up the KinesisConsumer to use the KinesisResumeAdapter this error is thrown.
java.lang.ClassCastException: Cannot cast org.apache.camel.support.resume.ResumeActionAwareAdapter to org.apache.camel.component.aws2.kinesis.consumer.KinesisResumeAdapter
at java.base/java.lang.Class.cast(Class.java:3889)
at org.apache.camel.resume.ResumeStrategy.getAdapter(ResumeStrategy.java:62)
I have isolated this to the following problem.
The KinesisConsumer DOES NOT override the default method in ResumeAware that specified the adapter name:
default String adapterFactoryService()
This leads to a classpath clash with the camel-support jar that is also use the name adapter-factory. In this case the factory service when called for Kinesis creates the wrong type of adapter as above.
Other Resumable consumers have renamed their factory files for instance the file consumer uses file-adapter-factory.
I have created a work around locally (that I dont like) by creating in my own classpath a duplicate of the adapter factory. This is loaded in preference to the jar resources but is not a perm fix.
The fix required is to: * Change the Kinesis2Consumer to override the method above and return its own factory name such as kinesis-adapter-factory
- Change the build so that the adapter-factory file is replaced with kinesis-adapter-factory
Attachments
Attachments
Issue Links
- links to