Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

shuangkun
Copy link
Member

@shuangkun shuangkun commented Dec 19, 2023

Checklist:

Add AlibabaCloud MNS as eventsource for argo-events.

@shuangkun shuangkun requested a review from whynowy as a code owner December 19, 2023 07:30
@shuangkun shuangkun marked this pull request as draft December 19, 2023 07:31
@shuangkun shuangkun force-pushed the feat/AddMNS branch 2 times, most recently from 412078f to 6df3dac Compare December 19, 2023 12:50
@shuangkun shuangkun marked this pull request as ready for review December 19, 2023 14:02
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)
Copy link
Member

Choose a reason for hiding this comment

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

Remove it?

Copy link
Member Author

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 {
Copy link
Member

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?

@shuangkun shuangkun force-pushed the feat/AddMNS branch 2 times, most recently from 23919dd to ab2dc43 Compare January 4, 2024 13:53
case resp := <-respChan:
{
log.Infof("response: %v \n", resp)
log.Infof("change the visibility: %v \n", resp.ReceiptHandle)
Copy link
Member

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)
Copy link
Member

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 {
Copy link
Member

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)
Copy link
Member

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())
Copy link
Member

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 {
Copy link
Member

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?

eventsources/sources/alibabacloudmns/start.go Outdated Show resolved Hide resolved
@shuangkun shuangkun force-pushed the feat/AddMNS branch 2 times, most recently from ed51272 to 367e745 Compare January 10, 2024 10:06
Copy link
Contributor

This Pull Request is stale because it has been open for 60 days with
no activity. It will be closed in 7 days if no further activity.

@github-actions github-actions bot added the stale label Mar 11, 2024
@github-actions github-actions bot closed this Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants