In java, using flink-connector-kafka 3.1.0-1.18, I...
# troubleshooting
j
In java, using flink-connector-kafka 3.1.0-1.18, I'm trying to create a kafka sink with this delivery guarantee:
Copy code
.setDeliveryGuarantee(DeliveryGuarantee.AT_LEAST_ONCE)
But intellij cannot resolve the symbol 'DeliveryGuarantee'. I can't seem to find any answers to this online either πŸ€”
a
Seems to be an issue discussed in FLINK-33866. You need to add
provided
dependency to
flink-connector-base
. Something like this should work, if using maven:
Copy code
dependency
            groupIdorg.apache.flink/groupId
            artifactIdflink-connector-kafka/artifactId
            version3.1.0-1.18/version
        /dependency
        dependency
            groupIdorg.apache.flink/groupId
            artifactIdflink-connector-base/artifactId
            version1.18.1/version
            scopeprovided/scope
        /dependency
πŸ™Œ 1
t
The issue likely stems from a missing import, version mismatch, or incorrect API usage. Ensure you've correctly imported
DeliveryGuarantee
, you're using a version of Flink Kafka Connector that supports this enum, and you're applying it correctly in your Kafka sink setup. Double-check your project dependencies and refresh IntelliJ's project cache if necessary.
j
Copy code
<dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-connector-base</artifactId>
            <version>1.18.1</version>
            <scope>provided</scope>
        </dependency>
Was missing this dependency. Thank you. Is it me, or should the docs include this dependency? Without your help in here, I don't know how else I could have come to this conclusion. Thank you. https://nightlies.apache.org/flink/flink-docs-release-1.18/docs/connectors/datastream/kafka/