jason810496 opened a new pull request, #74538:
URL: https://github.com/apache/airflow/pull/74538
## Why
Every task of a native Java Dag runs on the Java coordinator, so each one
needs a queue that `[sdk] queue_to_coordinator` routes there. Airflow's Dag has
no queue setting, so authors had to repeat the same queue on every task. The Go
and TypeScript SDKs already take a Dag-level queue; this gives Java the same.
## What changes
`queue` can be set once on the Dag, in both styles. Each task inherits it,
unless the task sets its own `queue`.
```java
// Annotation style.
@Builder.Dag(id = "etl", schedule = "@daily", queue = "java")
public class Etl { ... }
// Interface style.
var dag = new DagDef("etl").config("queue", "java");
dag.task("extract", Extract.class); // runs on
"java"
dag.task("heavy", Heavy.class).config("queue", "java_large"); // its own
queue wins
```
- Same rules as Go and TypeScript: conditions, switches and `TriggerDagRun`
tasks inherit the queue too, a task's own queue always wins, and the queue is
never written on the serialized Dag itself.
- The native Java examples now set `queue = "java"`, which the README's
setup already routes to the Java coordinator.
---
##### Was generative AI tooling used to co-author this PR?
- [x] Yes, with help of Claude Code Opus 5.5 following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]