Otavio Rodolfo Piske created CAMEL-15219:
--------------------------------------------

             Summary: camel-cassandraql: cannot use a custom 
resultSetConversionStrategy
                 Key: CAMEL-15219
                 URL: https://issues.apache.org/jira/browse/CAMEL-15219
             Project: Camel
          Issue Type: Bug
    Affects Versions: 3.3.0
            Reporter: Otavio Rodolfo Piske


According to the 
[documentation|https://camel.apache.org/components/latest/cql-component.html], 
it should be possible to use a custom ResultSetConversionStrategy on the 
camel-cassandraql component. 

However, it seems it is not accepted in all cases and ends up failing to create 
the custom conversion. For example, using #bean:org.my.package.MyStrategy 
causes a failure similar to this:


{quote}Caused by: java.lang.IllegalArgumentException: Unknown conversion 
strategy 
#bean:org.apache.camel.kafkaconnector.cassandra.clients.dao.TestResultSetConversionStrategy
        at 
org.apache.camel.component.cassandra.ResultSetConversionStrategies.fromName(ResultSetConversionStrategies.java:112)
 ~[camel-cassandraql-3.3.0.jar:3.3.0]
        at 
org.apache.camel.component.cassandra.CassandraComponent.createEndpoint(CassandraComponent.java:82)
 ~[camel-cassandraql-3.3.0.jar:3.3.0]
        at 
org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:237)
 ~[camel-support-3.3.0.jar:3.3.0]{quote}

Looking at the current code on master, this does seem to be that the code on  
[CassandraComponent.java|https://github.com/apache/camel/blob/961ca457e3e8120c4a9acdbe570669784bf3b12c/components/camel-cassandraql/src/main/java/org/apache/camel/component/cassandra/CassandraComponent.java#L82]
 and, more importantly, 
[ResultSetConversionStrategies.java|https://github.com/apache/camel/blob/961ca457e3e8120c4a9acdbe570669784bf3b12c/components/camel-cassandraql/src/main/java/org/apache/camel/component/cassandra/ResultSetConversionStrategies.java#L97]
 do not behave like stated on the documentation (ie.: _"... Anything else, if 
resultSetConversionStrategy is a custom implementation of the 
ResultSetConversionStrategy ..."_).









--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to