You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "junaiddshaukat (via GitHub)" <gi...@apache.org> on 2026/05/16 10:35:46 UTC
[PR] GSoC 2026] Add Kafka Streams runner skeleton module + portable entry points [beam]
junaiddshaukat opened a new pull request, #38521:
URL: https://github.com/apache/beam/pull/38521
## Summary
- Adds new `runners/kafka-streams` Gradle module and wires it into build/settings.
- Introduces initial runner surface: `KafkaStreamsRunner`, options, registrar, job server driver, job invoker, and translation context.
- Adds stub translator behavior that fails clearly with `No translator registered for URN ...` for unsupported transforms.
- Updates `CHANGES.md` with the new runner skeleton entry.
## Validation
- `./gradlew :runners:kafka-streams:compileJava`
- `./gradlew :runners:kafka-streams:check`
## Scope
This PR intentionally provides skeleton plumbing only.
No transform translators, watermark manager, or state implementation are included yet.
Closes #38465
cc @je-ik
------------------------
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
- [ ] Mention the appropriate issue in your description (for example: `addresses #123`), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment `fixes #<ISSUE NUMBER>` instead.
- [ ] Update `CHANGES.md` with noteworthy changes.
- [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
See the [Contributor Guide](https://beam.apache.org/contribute) for more tips on [how to make review process smoother](https://github.com/apache/beam/blob/master/CONTRIBUTING.md#make-the-reviewers-job-easier).
To check the build health, please visit [https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
GitHub Actions Tests Status (on master branch)
------------------------------------------------------------------------------------------------
[](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Go+tests%22+branch%3Amaster+event%3Aschedule)
See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more information about GitHub Actions CI or the [workflows README](https://github.com/apache/beam/blob/master/.github/workflows/README.md) to see a list of phrases to trigger workflows.
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [GSoC 2026] Add Kafka Streams runner skeleton module + portable entry points [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #38521:
URL: https://github.com/apache/beam/pull/38521#issuecomment-4466763353
Assigning reviewers:
R: @shunping added as fallback since no labels match configuration
Note: If you would like to opt out of this review, comment `assign to next reviewer`.
Available commands:
- `stop reviewer notifications` - opt out of the automated review tooling
- `remind me after tests pass` - tag the comment author after tests pass
- `waiting on author` - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)
The PR bot will only process comments in the main thread (not review comments).
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [GSoC 2026] Add Kafka Streams runner skeleton module + portable entry points [beam]
Posted by "je-ik (via GitHub)" <gi...@apache.org>.
je-ik commented on PR #38521:
URL: https://github.com/apache/beam/pull/38521#issuecomment-4470257307
@junaiddshaukat I will walk through the PR ASAP, but can you please change the target branch? We don't want this subtask to hit master branck right now. Thanks!
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GSoC 2026] Add Kafka Streams runner skeleton module + portable entry points [beam]
Posted by "gemini-code-assist[bot] (via GitHub)" <gi...@apache.org>.
gemini-code-assist[bot] commented on code in PR #38521:
URL: https://github.com/apache/beam/pull/38521#discussion_r3252679733
##########
runners/kafka-streams/src/main/java/org/apache/beam/runners/kafka/streams/KafkaStreamsPipelineResult.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beam.runners.kafka.streams;
+
+import java.io.IOException;
+import org.apache.beam.sdk.PipelineResult;
+import org.apache.beam.sdk.metrics.MetricResults;
+import org.joda.time.Duration;
+
+/**
+ * Forwards {@link PipelineResult} calls to a delegate and stops an embedded job server when the
+ * pipeline reaches a terminal state.
+ */
+class KafkaStreamsPipelineResult implements PipelineResult {
+
+ private final PipelineResult delegate;
+ private final Runnable stopJobServer;
+
+ KafkaStreamsPipelineResult(PipelineResult delegate, Runnable stopJobServer) {
+ this.delegate = delegate;
+ this.stopJobServer = stopJobServer;
+ }
+
+ @Override
+ public State getState() {
+ return delegate.getState();
+ }
+
+ @Override
+ public State cancel() throws IOException {
+ State state = delegate.cancel();
+ stopJobServer.run();
+ return state;
+ }
+
+ @Override
+ public State waitUntilFinish(Duration duration) {
+ State state = delegate.waitUntilFinish(duration);
+ stopJobServer.run();
+ return state;
+ }
+
+ @Override
+ public State waitUntilFinish() {
+ State state = delegate.waitUntilFinish();
+ stopJobServer.run();
+ return state;
+ }
Review Comment:

It is safer to stop the job server in a `finally` block to ensure cleanup even if `waitUntilFinish()` throws an exception (e.g., due to communication issues with the server).
```java
@Override
public State waitUntilFinish() {
try {
return delegate.waitUntilFinish();
} finally {
stopJobServer.run();
}
}
```
##########
runners/kafka-streams/src/main/java/org/apache/beam/runners/kafka/streams/KafkaStreamsPipelineResult.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beam.runners.kafka.streams;
+
+import java.io.IOException;
+import org.apache.beam.sdk.PipelineResult;
+import org.apache.beam.sdk.metrics.MetricResults;
+import org.joda.time.Duration;
+
+/**
+ * Forwards {@link PipelineResult} calls to a delegate and stops an embedded job server when the
+ * pipeline reaches a terminal state.
+ */
+class KafkaStreamsPipelineResult implements PipelineResult {
+
+ private final PipelineResult delegate;
+ private final Runnable stopJobServer;
+
+ KafkaStreamsPipelineResult(PipelineResult delegate, Runnable stopJobServer) {
+ this.delegate = delegate;
+ this.stopJobServer = stopJobServer;
+ }
+
+ @Override
+ public State getState() {
+ return delegate.getState();
+ }
+
+ @Override
+ public State cancel() throws IOException {
+ State state = delegate.cancel();
+ stopJobServer.run();
+ return state;
+ }
Review Comment:

The job server should be stopped even if `cancel()` throws an `IOException` to ensure resources are released. Using a `try-finally` block is recommended.
```java
@Override
public State cancel() throws IOException {
try {
return delegate.cancel();
} finally {
stopJobServer.run();
}
}
```
##########
runners/kafka-streams/src/main/java/org/apache/beam/runners/kafka/streams/KafkaStreamsPipelineResult.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beam.runners.kafka.streams;
+
+import java.io.IOException;
+import org.apache.beam.sdk.PipelineResult;
+import org.apache.beam.sdk.metrics.MetricResults;
+import org.joda.time.Duration;
+
+/**
+ * Forwards {@link PipelineResult} calls to a delegate and stops an embedded job server when the
+ * pipeline reaches a terminal state.
+ */
+class KafkaStreamsPipelineResult implements PipelineResult {
+
+ private final PipelineResult delegate;
+ private final Runnable stopJobServer;
+
+ KafkaStreamsPipelineResult(PipelineResult delegate, Runnable stopJobServer) {
+ this.delegate = delegate;
+ this.stopJobServer = stopJobServer;
+ }
+
+ @Override
+ public State getState() {
+ return delegate.getState();
+ }
+
+ @Override
+ public State cancel() throws IOException {
+ State state = delegate.cancel();
+ stopJobServer.run();
+ return state;
+ }
+
+ @Override
+ public State waitUntilFinish(Duration duration) {
+ State state = delegate.waitUntilFinish(duration);
+ stopJobServer.run();
+ return state;
+ }
Review Comment:

The current implementation stops the job server even if `waitUntilFinish(duration)` times out and the pipeline is still running. This prevents further interaction with the job. The server should only be stopped if the pipeline has reached a terminal state.
```java
@Override
public State waitUntilFinish(Duration duration) {
State state = delegate.waitUntilFinish(duration);
if (state != null && state.isTerminal()) {
stopJobServer.run();
}
return state;
}
```
##########
runners/kafka-streams/src/main/java/org/apache/beam/runners/kafka/streams/KafkaStreamsPipelineOptions.java:
##########
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beam.runners.kafka.streams;
+
+import java.nio.file.Paths;
+import org.apache.beam.sdk.options.Default;
+import org.apache.beam.sdk.options.DefaultValueFactory;
+import org.apache.beam.sdk.options.Description;
+import org.apache.beam.sdk.options.PipelineOptions;
+import org.apache.beam.sdk.options.PortablePipelineOptions;
+
+/** Pipeline options for the Kafka Streams runner. */
+public interface KafkaStreamsPipelineOptions extends PortablePipelineOptions {
+
+ @Description("Comma-separated list of host:port Kafka brokers used by the Kafka Streams client.")
+ @Default.String("localhost:9092")
+ String getBootstrapServers();
+
+ void setBootstrapServers(String bootstrapServers);
+
+ @Description(
+ "Kafka Streams application.id (must be unique for each distinct topology using the same "
+ + "input topics in a Kafka cluster).")
+ @Default.String("beam-kafka-streams-runner")
+ String getApplicationId();
+
+ void setApplicationId(String applicationId);
+
+ @Description(
+ "Kafka Streams processing.guarantee setting, for example at_least_once or exactly_once_v2.")
+ @Default.String("exactly_once_v2")
+ String getProcessingGuarantee();
+
+ void setProcessingGuarantee(String processingGuarantee);
+
+ @Description("Soft cap on the number of elements per bundle.")
+ @Default.Integer(1000)
+ int getMaxBundleSize();
+
+ void setMaxBundleSize(int maxBundleSize);
+
+ @Description("Soft cap on bundle wall-clock duration in milliseconds.")
+ @Default.Integer(1000)
+ int getMaxBundleTimeMs();
+
+ void setMaxBundleTimeMs(int maxBundleTimeMs);
+
+ @Description("Directory where Kafka Streams stores local state.")
+ @Default.InstanceFactory(StateDirDefaultFactory.class)
+ String getStateDir();
+
+ void setStateDir(String stateDir);
+
+ /** Default {@link #getStateDir()} under the JVM temp directory. */
+ class StateDirDefaultFactory implements DefaultValueFactory<String> {
+ @Override
+ public String create(PipelineOptions options) {
+ return Paths.get(System.getProperty("java.io.tmpdir"), "beam-kafka-streams-state").toString();
Review Comment:

Using a fixed path for the Kafka Streams state directory in the system temp directory can cause conflicts and `LockException` when multiple pipelines (e.g., parallel tests) run on the same host. It is recommended to include the job name to ensure uniqueness.
```suggestion
return Paths.get(System.getProperty("java.io.tmpdir"), "beam-kafka-streams-state", options.getJobName()).toString();
```
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GSoC 2026] Add Kafka Streams runner skeleton module + portable entry points [beam]
Posted by "gemini-code-assist[bot] (via GitHub)" <gi...@apache.org>.
gemini-code-assist[bot] commented on PR #38521:
URL: https://github.com/apache/beam/pull/38521#issuecomment-4466598440
## Summary of Changes
Hello, I'm Gemini Code Assist[^1]! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request establishes the foundational skeleton for a new Kafka Streams runner in Apache Beam. It sets up the necessary project structure, build configurations, and core portable runner entry points. The implementation currently focuses on plumbing, ensuring that the runner can be registered and invoked, while providing a fail-fast mechanism for pipeline translation until specific transform support is added.
### Highlights
* **New Gradle Module**: Introduced the `runners/kafka-streams` module and integrated it into the build system and settings.
* **Runner Surface Area**: Implemented the initial Kafka Streams runner infrastructure, including `KafkaStreamsRunner`, pipeline options, registrar, job server driver, and job invoker.
* **Stub Translation Logic**: Added a skeleton translator that provides clear error messaging for unsupported transforms, serving as a foundation for future implementation.
<details>
<summary><b>New Features</b></summary>
🧠You can now enable **Memory** (public preview) to help **Gemini Code Assist** learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. **Click [here](https://codeassist.google/code-review/login) to enable Memory in your admin console.**
</details>
<details>
<summary><b>Using Gemini Code Assist</b></summary>
<br>
The full guide for Gemini Code Assist can be found on our [documentation page](https://developers.google.com/gemini-code-assist/docs/review-github-code), here are some quick tips.
<b>Invoking Gemini</b>
You can request assistance from Gemini at any point by creating a comment using either `/gemini <command>` or `@gemini-code-assist <command>`. Below is a summary of the supported commands on the current page.
Feature | Command | Description
--- | --- | ---
Code Review | `/gemini review` | Performs a code review for the current pull request in its current state.
Pull Request Summary | `/gemini summary` | Provides a summary of the current pull request in its current state.
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help | `/gemini help` | Displays a list of available commands.
<b>Customization</b>
To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a `.gemini/` folder in the base of the repository. Detailed instructions can be found [here](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github).
<b>Limitations & Feedback</b>
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with :thumbsup: and :thumbsdown: on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up [here](https://google.qualtrics.com/jfe/form/SV_2cyuGuTWsEw84yG).
</details>
[^1]: Review the [Privacy Notices](https://policies.google.com/privacy), [Generative AI Prohibited Use Policy](https://policies.google.com/terms/generative-ai/use-policy), [Terms of Service](https://policies.google.com/terms), and learn how to configure Gemini Code Assist in GitHub [here](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github). Gemini can make mistakes, so double check it and [use code with caution](https://support.google.com/legal/answer/13505487).
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [GSoC 2026] Add Kafka Streams runner skeleton module + portable entry points [beam]
Posted by "junaiddshaukat (via GitHub)" <gi...@apache.org>.
junaiddshaukat commented on PR #38521:
URL: https://github.com/apache/beam/pull/38521#issuecomment-4470270201
> @junaiddshaukat I will walk through the PR ASAP, but can you please change the target branch? We don't want this subtask to hit master branck right now. Thanks!
@je-ik sure, changing it right now
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [GSoC 2026] Add Kafka Streams runner skeleton module + portable entry points [beam]
Posted by "junaiddshaukat (via GitHub)" <gi...@apache.org>.
junaiddshaukat closed pull request #38521: [GSoC 2026] Add Kafka Streams runner skeleton module + portable entry points
URL: https://github.com/apache/beam/pull/38521
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [GSoC 2026] Add Kafka Streams runner skeleton module + portable entry points [beam]
Posted by "junaiddshaukat (via GitHub)" <gi...@apache.org>.
junaiddshaukat commented on PR #38521:
URL: https://github.com/apache/beam/pull/38521#issuecomment-4470300897
Moving review to fork PR per my mentor (@je-ik) guidance: https://github.com/junaiddshaukat/beam/pull/1
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org