I want to invoke few java methods from an Airflow task(s) since I already have lots of code written in java including validation, cleansing, some business logic and I don't want to rewrite that in Python again.
I am using Airflow 2.1.0
I know there is a way to invoke a jar using BashOperator
jar_task = BashOperator(
task_id='java',
bash_command='java -jar somejar.jar',
dag=dag
)
But is there any way using which I can call any specific java class or method directly from the task itself, otherwise I have to create many small jars for each of my logic.
Thanks in advance.