-
Notifications
You must be signed in to change notification settings - Fork 639
[ISSUE#4552] Add example for spring connector sdk. #4553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4553 +/- ##
============================================
+ Coverage 16.30% 16.39% +0.09%
- Complexity 1592 1603 +11
============================================
Files 747 747
Lines 28965 28965
Branches 2541 2541
============================================
+ Hits 4723 4750 +27
+ Misses 23793 23764 -29
- Partials 449 451 +2
... and 4 files with indirect coverage changes 📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; | ||
|
||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the role of exclude = {DataSourceAutoConfiguration.class}
?
|
||
@Override | ||
public void onSuccess(SendResult sendResult) { | ||
log.info("send message success! msgId={}, topic={}", sendResult.getMessageId(), sendResult.getTopic()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SendMessageCallback
here is not a callback when sending a message succeeds or fails, but a callback when Source obtains the message successfully or unsuccessfully after successfully sending the message. Could you optimize the log content to avoid misleading users?
这里的SendMessageCallback
不是发送消息成功/失败的回调,是发送消息成功后,被Source获取成功/失败后的回调。是不是可以修改下日志内容以免误导用户?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not necessarily that the message was sent successfully. The trigger timing here is that when the SourceWorker
sends the message to the eventmesh, there is an exception.
不一定是发送消息成功, 这里的触发时机是 SourceWorker发送消息到eventmesh时, 出现了异常。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for correcting me. You are right. Is this log easy for users to mistake it for triggering onSuccess()
when SpringSourceConnector.send()
sending messages successfully?
谢谢纠正,你是对的。现在的日志是不是容易让用户误以为是SpringSourceConnector.send()
发送消息成功时触发onSuccess()
?
|
||
@Override | ||
public void onException(SendExcepionContext sendExcepionContext) { | ||
log.info("send message failed!", sendExcepionContext.getCause()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above. When this method is executed, the message must have been successfully sent.
和上面一样。当该方法被执行时,消息肯定是发送成功的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this log easy for users to mistake it for triggering onException()
when SpringSourceConnector.send()
sending messages failed?
现在的日志是不是容易让用户误以为是SpringSourceConnector.send()
发送消息失败时触发onException()
?
* Feat: Add example for spring. * fix: Remove exclude configuration. * fix: fix log
Fixes #4552 .
Modifications
Add example for spring connector sdk.