Repository navigation
fix(#9): Add Knative eventing example using Apache Camel - #21
Merged
Merged
Conversation
Generated by Bob (IBM) via /oss-fix-issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #9
Adds a new example module that demonstrates a Quarkus application using Apache Camel to produce CloudEvents to a Knative eventing broker, with a Citrus integration test that runs entirely without a Kubernetes cluster.
What's in the module
Application
Routes.java— A Camel route driven bykamelet:timer-sourcethat transforms the message to a CloudEvent viatransformDataType("http:application-cloudevents")and posts it to the Knative broker withcamel-quarkus-knative-producer.knative.json— Camel Knative environment descriptor. Uses{{k.sink}}as the broker URL placeholder, following the Knative SinkBinding convention.application.properties— Setscamel.component.knative.environment-path=classpath:knative.json.Test
QuarkusApplicationTest.java— Citrus test usingClusterType.LOCAL: Citrus starts a local Jetty HTTP server onlocalhost:8080as the broker, then receives and validates the CloudEvent (body,ce-id,ce-type,ce-source,Content-Type).src/test/resources/application.properties— Setsk.sink=http://localhost:8080so the Camel route posts to the Citrus local broker.Key design decisions
classpath:knative.jsoninstead offile:knative.jsonso the config resolves correctly from the JAR both in tests and production builds.ClusterType.LOCALpassed explicitly on thecreateBroker()builder rather than relying on environment variables, making the test portable with zero setup.transformDataType("http:application-cloudevents")is required to make Camel setce-source=org.apache.camel; without it the source defaults to the route ID.camel-kameletsandcamel-quarkus-yaml-dsldependencies — both are needed at runtime to load and execute thetimer-source.kamelet.yamldefinition.Validation
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0mvn clean install -DskipTests— all 21 modules pass.Generated by Bob (IBM) via /oss-fix-issue