Skip to content

Conversation

@Fungx
Copy link
Contributor

@Fungx Fungx commented Dec 10, 2023

Fixes #4618.

Motivation

Add Http source connector.

Modifications

  • Add Http source connector
  • Add unit tests for Http source connector

Documentation

  • Does this pull request introduce a new feature? yes
  • If yes, how is the feature documented? docs. Please refer to http-protocol-binding
  • If a feature is not applicable for documentation, explain why?
  • If a feature is not documented yet in this PR, please create a followup issue for adding the documentation

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to the Apache EventMesh community!!
This is your first PR in our project. We're very excited to have you onboard contributing. Your contributions are greatly appreciated!

Please make sure that the changes are covered by tests.
We will be here shortly.
Let us know if you need any help!

Want to get closer to the community?

WeChat Assistant WeChat Public Account Slack
Join Slack Chat

Mailing Lists:

Name Description Subscribe Unsubscribe Archive
Users User support and questions mailing list Subscribe Unsubscribe Mail Archives
Development Development related discussions Subscribe Unsubscribe Mail Archives
Commits All commits to repositories Subscribe Unsubscribe Mail Archives
Issues Issues or PRs comments and reviews Subscribe Unsubscribe Mail Archives

checker-qual-3.12.0.jar
cloudevents-api-2.4.2.jar
cloudevents-core-2.4.2.jar
cloudevents-http-vertx-2.3.0.jar
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from cloudevents-http-vertx and vertx-web, are there any unnecessary dependencies in the newly added dependencies?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many newly added dependencies are indirectly imported by vertx. I can't pass the License Check of CI/CD after removing them.

Actually, I'm confused about known-dependencies.txt. Why do we need to manually add dependencies here? Since we are already using a build tool.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I'm confused about known-dependencies.txt. Why do we need to manually add dependencies here? Since we are already using a build tool.

I don't fully understand either, I only know that the script check-dependencies.sh for checking dependencies will use this file to check. I also want to know the purpose of using this method of checking @ruanwenjun , and whether there is a better way.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to use the known-dependencies to recognize which packages are new dependencies and make sure these new dependencies must under the ASF 3rd party license policy. @Fungx @pandaapo

Copy link
Contributor Author

@Fungx Fungx Dec 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have manually comfirmed that these newly added dependencies(vertx , netty & cloudevents-http-vertx) are under the ASF 3rd party license policy, since they are all using Apache License 2.0. Is this correct? @xwm1992

Copy link
Member

@pandaapo pandaapo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be willing to write a document(#4601 (comment)) for this connector? If you are willing, they can be written in this PR or in a new PR.

@Fungx
Copy link
Contributor Author

Fungx commented Dec 10, 2023

Would you be willing to write a document(#4601 (comment)) for this connector? If you are willing, they can be written in this PR or in a new PR.

Of course. I'll write it in a new PR.

@codecov
Copy link

codecov bot commented Dec 11, 2023

Codecov Report

Attention: 28 lines in your changes are missing coverage. Please review.

Comparison is base (ee9ee4c) 16.93% compared to head (2e8ac4a) 17.38%.
Report is 3 commits behind head on master.

Files Patch % Lines
...tor/http/source/connector/HttpSourceConnector.java 74.07% 11 Missing and 3 partials ⚠️
...tmesh/connector/http/server/HttpConnectServer.java 0.00% 7 Missing ⚠️
...ntmesh/connector/http/config/HttpServerConfig.java 0.00% 4 Missing ⚠️
...ctor/http/source/config/SourceConnectorConfig.java 60.00% 2 Missing ⚠️
...connector/http/source/config/HttpSourceConfig.java 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #4634      +/-   ##
============================================
+ Coverage     16.93%   17.38%   +0.45%     
- Complexity     1708     1757      +49     
============================================
  Files           790      797       +7     
  Lines         29526    29770     +244     
  Branches       2550     2573      +23     
============================================
+ Hits           5001     5177     +176     
- Misses        24061    24115      +54     
- Partials        464      478      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

pandaapo
pandaapo previously approved these changes Dec 11, 2023
Copy link
Member

@pandaapo pandaapo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Welcome!

@hhuang1231
Copy link
Contributor

Maybe this question shouldn't be asked here, but I still want to know why most sourceConnectors don't implement the commit() method.

@pandaapo
Copy link
Member

pandaapo commented Dec 11, 2023

Maybe this question shouldn't be asked here, but I still want to know why most sourceConnectors don't implement the commit() method.

@hhuang1231
commit() is mainly used to record the offset of messages that need to be persisted, and to avoid duplicate transmission of such messages as much as possible. However, not all connectors need to implement it, such as this Connector and the Lark Connector you refactored. Connectors such as RocketMQ, RabbitMQ, Kafka, MySQL, etc. should implement to make them more reliable. Of course, there are currently some connectors that need to implement it but have not implemented. The community wants to gradually improve the functionality of a Connector and does not require contributors to implement all functions in one PR.

commit()是主要用于记录需要持久化的消息的位移,尽量避免这类消息的重复传输,但不是所有的Connector都需要实现,像该Connector、您重构的Lark Connector等不需要实现。像RocketMQ、RabbitMQ、Kafka、MySQL等这类的Connector,应该实现,这样Connector会更加可靠。当然,目前有一些需要实现的Connector并没有实现,社区是想逐步完善一个Connector的功能,不强制要求贡献者这在一次PR中实现所有功能。

Copy link
Member

@Pil0tXia Pil0tXia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job.

Comment on lines 74 to 76

private void doInit() throws Exception {
this.queue = new LinkedBlockingQueue<>(1000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant throws Exception at doInit(), start() and stop() can be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. And now the trace stack will be logged by the outside SourceWorker.

@Fungx Fungx force-pushed the feat_http_source branch 3 times, most recently from 2589415 to cf49f64 Compare December 11, 2023 13:36
Copy link
Member

@Pil0tXia Pil0tXia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@xwm1992 xwm1992 merged commit a531968 into apache:master Dec 12, 2023
@xwm1992 xwm1992 added this to the 1.10 milestone Dec 12, 2023
@pandaapo
Copy link
Member

Would you be willing to write a document(#4601 (comment)) for this connector? If you are willing, they can be written in this PR or in a new PR.

Of course. I'll write it in a new PR.

@Fungx In the future, community will mainly maintain documents in eventmesh-site. Therefore, if it is convenient for you, please write the new English documents in this directory of eventmesh-site, and Chinese documents in the directory.

@Fungx
Copy link
Contributor Author

Fungx commented Dec 28, 2023

Would you be willing to write a document(#4601 (comment)) for this connector? If you are willing, they can be written in this PR or in a new PR.

Of course. I'll write it in a new PR.

@Fungx In the future, community will mainly maintain documents in eventmesh-site. Therefore, if it is convenient for you, please write the new English documents in this directory of eventmesh-site, and Chinese documents in the directory.

Sure. Leave it to me.

xuhongjia pushed a commit to Deckers-Ohana/eventmesh that referenced this pull request Mar 13, 2025
* [ISSUE apache#4618] Add HTTP source connector

* fix exception & config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add HTTP source Connector

5 participants