flink1.12 不能同时在一个工程消费jdbc和kafka CDC数据

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

flink1.12 不能同时在一个工程消费jdbc和kafka CDC数据

nosstock
用的是flink1.12 quickstart mvn的工程模板,在工程里面一个类从kafka消费CDC数据,一个类从mysql消费CDC数据,如果mvn
pom文件这样配置            org.apache.flink    
flink-connector-kafka_${scala.binary.version}      ${flink.version}            
org.apache.flink      flink-connector-jdbc_${scala.binary.version}    
${flink.version}     则kafka消费的应用执行成功,消费mysql的应用报Caused by:
org.apache.flink.table.api.ValidationException: Could not find any factory
for identifier 'jdbc' that implements
'org.apache.flink.table.factories.DynamicTableFactory' in the classpath.
如果把两个依赖的顺序换一下            org.apache.flink    
flink-connector-jdbc_${scala.binary.version}      ${flink.version}                
org.apache.flink      flink-connector-kafka_${scala.binary.version}    
${flink.version}     则mysql消费的应用这些成功,消费kafka的应用报Caused by:
org.apache.flink.table.api.ValidationException: Could not find any factory
for identifier 'kafka' that implements
'org.apache.flink.table.factories.DynamicTableFactory' in the classpath.



--
Sent from: http://apache-flink.147419.n8.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: flink1.12 不能同时在一个工程消费jdbc和kafka CDC数据

silence-2

可以尝试在shade插件里加个transformer
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>



--
Sent from: http://apache-flink.147419.n8.nabble.com/