-
Notifications
You must be signed in to change notification settings - Fork 748
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
feat: add alibabacloud mns as eventsource #2951
Conversation
412078f
to
6df3dac
Compare
log.Infof("visibility changed: %v\n", ret) | ||
log.Infof("delete it now: %v\n", ret.ReceiptHandle) | ||
if e := queue.DeleteMessage(ret.ReceiptHandle); e != nil { | ||
fmt.Println(e) |
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.
Remove it?
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.
okay, I change it.
} | ||
queue := ali_mns.NewMNSQueue(el.MNSEventSource.Queue, *mnsClient, 50) | ||
|
||
for { |
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.
Curious, how to break this for loop when the application exits?
23919dd
to
ab2dc43
Compare
case resp := <-respChan: | ||
{ | ||
log.Infof("response: %v \n", resp) | ||
log.Infof("change the visibility: %v \n", resp.ReceiptHandle) |
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.
Does this log make sense?
} | ||
eventBytes, err := json.Marshal(eventData) | ||
if err != nil { | ||
log.Errorf("failed to marshal the event data, rejecting the event, %w", err) |
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.
Instead of dispatching, should it be skipped when there's an error?
if err = dispatch(eventBytes); err != nil { | ||
log.Errorf("failed to dispatch ali mns event, %w", err) | ||
} | ||
if ret, e := queue.ChangeMessageVisibility(resp.ReceiptHandle, 5); e != nil { |
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 reason it needs to change visibility before deleting?
log.Errorf("failed to dispatch ali mns event, %w", err) | ||
} | ||
if ret, e := queue.ChangeMessageVisibility(resp.ReceiptHandle, 5); e != nil { | ||
log.Info(e) |
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 e
an error?
log.Infof("visibility changed: %v\n", ret) | ||
log.Infof("delete it now: %v\n", ret.ReceiptHandle) | ||
if e := queue.DeleteMessage(ret.ReceiptHandle); e != nil { | ||
log.Infof("delete err: %v\n", e.Error()) |
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.
Errorf
?
errChan := make(chan error) | ||
endChan := make(chan int) | ||
go func() { | ||
select { |
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.
How to exit this goroutine when receiving a SIGTERM?
ed51272
to
367e745
Compare
Signed-off-by: shuangkun <[email protected]>
367e745
to
bf99dcf
Compare
This Pull Request is stale because it has been open for 60 days with |
Checklist:
Add AlibabaCloud MNS as eventsource for argo-events.