Skip to content

Add Quarkus Kafka sidecar delivery E2E test - #4112

Open
aliok wants to merge 3 commits into
knative:mainfrom
aliok:test-kafka-quarkus-delivery
Open

aliok wants to merge 3 commits into
knative:mainfrom
aliok:test-kafka-quarkus-delivery

Conversation

@aliok

@aliok aliok commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Changes

  • 🎁 Add an integration test proving the Kafka runtime sidecar delivers to Quarkus/Java end to end: a plain Funqy cloudevents function, built and deployed through func on the keda deployer, receives Kafka records via the injected sidecar as CloudEvents over HTTP — the function itself contains no Kafka code.
  • 🎁 Cover both delivery shapes the sidecar emits, since Funqy binds event data by type (unlike Python's untyped accessor). The handler fixture declares two @Funq methods routed by CloudEvent type, and the test produces two records: a plain record (wrapped by the sidecar as dev.knative.kafka.event with application/octet-stream data, bound as raw bytes) and a record carrying ce_* headers with a JSON body (passed through and bound to the typed Input POJO). Each echoes its payload so a unique per-shape token can be asserted in the function log, and the consumer group must drain to lag 0.

This mirrors the Python delivery test (#4111) and reuses its helpers. The handler, its application.properties (dropping the single-function export so the two methods route by type), and a placeholder unit test (keeping src/test compiling after the handler swap) live as committed fixtures under pkg/keda/testdata/kafka_quarkus_delivery. Deploy forces the pack builder since the host builder does not support Quarkus, and the timeout is widened for the Maven build. No template or runtime changes are needed; the stock quarkus/cloudevents template is already a plain CloudEvents-over-HTTP receiver.

It runs against the same Strimzi broker the Kafka integration job already provisions and is picked up by the existing test-integration-kafka target, so no CI changes are needed.

/kind enhancement

Fixes #

Release Note


Docs


@knative-prow

knative-prow Bot commented Oct 27, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@knative-prow knative-prow Bot added kind/enhancement Feature additions or improvements to existing do-not-merge/work-in-progress 🤖 PR should not merge because it is a work in progress. labels Oct 27, 2026
@knative-prow

knative-prow Bot commented Oct 27, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aliok

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow Bot added approved 🤖 PR has been approved by an approver from all required OWNERS files. size/XL 🤖 PR changes 500-999 lines, ignoring generated files. labels Oct 27, 2026
@aliok
aliok force-pushed the test-kafka-quarkus-delivery branch from e4a22b6 to 66a8867 Compare October 30, 2026 12:58
@knative-prow knative-prow Bot added size/L 🤖 PR changes 100-499 lines, ignoring generated files. and removed size/XL 🤖 PR changes 500-999 lines, ignoring generated files. labels Oct 30, 2026
aliok added 3 commits October 30, 2026 16:51
Mirror the Python delivery test for Quarkus/Java, proving a plain
Funqy cloudevents function receives Kafka records through the injected
runtime sidecar as CloudEvents over HTTP, with no Kafka code in the
function itself.

Quarkus binds event data by type, unlike Python's untyped get_data(),
so the handler fixture declares two @FunQ methods routed by CloudEvent
type and the test exercises both shapes the sidecar emits: a plain
record wrapped as dev.knative.kafka.event with octet-stream data (bound
as raw bytes), and a record carrying ce_* headers with a JSON body
(passed through and bound to the Input POJO). Each echoes its payload so
a unique per-shape token can be asserted in the function log, and the
consumer group must drain to lag 0.

The handler, its application.properties (dropping the single-function
export so the two methods route by type), and a placeholder unit test
(keeping src/test compiling after the handler swap) live as committed
fixtures. Deploy forces the pack builder since the host builder does
not support Quarkus, and the timeout is widened for the Maven build.
Same fix as the Python delivery test: func create derives the function
name from the directory basename, and t.TempDir()'s numeric leaf is not
a valid function name. Nest the function in a validly named subdirectory.
The Quarkus delivery test deploys through func into the slim Kafka
integration cluster, which skips serving and so has no Contour ingress;
registry.localtest.me is therefore unreachable for the host-side push.
Push to localhost:5001 instead, matching the serving-less registry
mapping that hack/cluster.sh now sets up (host port 5001 -> the node's
registry, chosen over 5000 to dodge the macOS AirPlay receiver).

This branch is stacked on that cluster.sh change; rebase onto main once
it lands.
@aliok
aliok force-pushed the test-kafka-quarkus-delivery branch from 66a8867 to 3e157bc Compare October 30, 2026 14:03
@aliok
aliok marked this pull request as ready for review October 30, 2026 14:03
@aliok aliok changed the title [WIP] Add Quarkus Kafka sidecar delivery E2E test Add Quarkus Kafka sidecar delivery E2E test Oct 30, 2026
@knative-prow knative-prow Bot removed the do-not-merge/work-in-progress 🤖 PR should not merge because it is a work in progress. label Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved 🤖 PR has been approved by an approver from all required OWNERS files. kind/enhancement Feature additions or improvements to existing size/L 🤖 PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant