Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
airflow-provider-kafka
Advanced tools
Apache Airflow Kafka provider containing Deferrable Operators & Sensors.
An airflow provider to:
This package currently contains
3 hooks (airflow_provider_kafka.hooks
) :
admin_client.KafkaAdminClientHook
- a hook to work against the actual kafka admin clientconsumer.KafkaConsumerHook
- a hook that creates a consumer and provides it for interactionproducer.KafkaProducerHook
- a hook that creates a producer and provides it for interaction4 operators (airflow_provider_kafka.operators
) :
await_message.AwaitKafkaMessageOperator
- a deferable operator (sensor) that awaits to encounter a message in the log before triggering down stream tasks.consume_from_topic.ConsumeFromTopicOperator
- an operator that reads from a topic and applies a function to each message fetched.produce_to_topic.ProduceToTopicOperator
- an operator that uses a iterable to produce messages as key/value pairs to a kafka topic.event_triggers_function.EventTriggersFunctionOperator
- an operator that listens for messages on the topic and then triggers a downstream function before going back to listening.1 trigger airflow_provider_kafka.triggers
:
await_message.AwaitMessageTrigger
pip install airflow-provider-kafka
Example usages :
Why confluent kafka and not (other library) ? A few reasons: the confluent-kafka library is guaranteed to be 1:1 functional with librdkafka, is faster, and is maintained by a company with a commercial stake in ensuring the continued quality and upkeep of it as a product.
Why not release this into airflow directly ? I could probably make the PR and get it through, but the airflow code base is getting huge and I don't want to burden the maintainers with code that they don't own for maintainence. Also there's been multiple attempts to get a Kafka provider in before and this is just faster.
Why is most of the configuration handled in a dict ? Because that's how confluent-kafka
does it. I'd rather maintain interfaces that people already using kafka are comfortable with as a starting point - I'm happy to add more options/ interfaces in later but would prefer to be thoughtful about it to ensure that there difference between these operators and the actual client interface are minimal.
Unit tests are located at tests/unit
, a kafka server isn't required to run these tests.
execute with pytest
Installing on M1 chip means a brew install of the librdkafka
library before you can pip install confluent-kafka
brew install librdkafka
export C_INCLUDE_PATH=/opt/homebrew/Cellar/librdkafka/1.8.2/include
export LIBRARY_PATH=/opt/homebrew/Cellar/librdkafka/1.8.2/lib
pip install confluent-kafka
FAQs
Apache Airflow Kafka provider containing Deferrable Operators & Sensors.
We found that airflow-provider-kafka demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.