eventmesh
eventmesh copied to clipboard
[ISSUE #790] Knative Connector: Initial Implementation of Producer.
Fixing ISSUE #790.
Motivation
Implemented and tested Producer module to publish an event to Knative (ISSUE #790). The PRs for ISSUE #790 will be merged into knative-connector branch.
Modifications
Followed the API design style of eventmesh-connector-rocketmq and made the following modifications.
Implementation:
- Producer for publishing an event message to Knative
- CloudEvent Reader, Writer, and Header
- Connector
- Unit test for Producer
- Included eventmesh-connector-knative in setting.gradle
How to Test:
Assume the cloudevents-player Knative service has already been set up on your local machine; otherwise, please follow the steps in https://knative.dev/docs/getting-started/first-source/#sending-an-event to set up a Knative service (cloudevents-player) as a sink.
# Do unit test:
$ cd incubator-eventmesh/eventmesh-connector-plugin/eventmesh-connector-knative
$ ../../gradlew clean test
# See the delivered event:
$ curl http://cloudevents-player.default.127.0.0.1.sslip.io/messages
Documentation
- Does this pull request introduce a new feature? yes.
- If yes, how is the feature documented? not documented.
- If a feature is not documented yet in this PR, please create a followup issue for adding the documentation. The followup issues or pull requests for documentation will be created after almost all implementation work has been finished.
@xwm1992 Please have a look when you have time. Thanks very much in advance!
Codecov Report
Merging #1027 (14810a0) into knative-connector (72a7b33) will increase coverage by
0.17%. The diff coverage is52.98%.
:exclamation: Current head 14810a0 differs from pull request most recent head f1e9245. Consider uploading reports for the commit f1e9245 to get more accurate results
@@ Coverage Diff @@
## knative-connector #1027 +/- ##
======================================================
+ Coverage 9.69% 9.87% +0.17%
- Complexity 610 629 +19
======================================================
Files 362 374 +12
Lines 23118 23244 +126
Branches 2546 2541 -5
======================================================
+ Hits 2241 2295 +54
- Misses 20675 20740 +65
- Partials 202 209 +7
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...ve/cloudevent/impl/KnativeBinaryMessageReader.java | 0.00% <0.00%> (ø) |
|
| ...nector/knative/cloudevent/impl/KnativeHeaders.java | 0.00% <0.00%> (ø) |
|
| ...h/connector/knative/common/EventMeshConstants.java | 0.00% <0.00%> (ø) |
|
| ...tmesh/connector/knative/utils/CloudEventUtils.java | 0.00% <0.00%> (ø) |
|
| ...onnector/knative/producer/KnativeProducerImpl.java | 47.05% <47.05%> (ø) |
|
| ...tmesh/connector/knative/producer/ProducerImpl.java | 50.00% <50.00%> (ø) |
|
| ...connector/knative/config/ConfigurationWrapper.java | 52.63% <52.63%> (ø) |
|
| .../knative/cloudevent/impl/KnativeMessageWriter.java | 66.66% <66.66%> (ø) |
|
| ...h/connector/knative/producer/AbstractProducer.java | 66.66% <66.66%> (ø) |
|
| .../connector/knative/config/ClientConfiguration.java | 90.00% <90.00%> (ø) |
|
| ... and 10 more |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more