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

AMQP does't work #673

Closed
moninCX opened this issue Apr 11, 2021 · 2 comments · Fixed by #687
Closed

AMQP does't work #673

moninCX opened this issue Apr 11, 2021 · 2 comments · Fixed by #687

Comments

@moninCX
Copy link

moninCX commented Apr 11, 2021

Hi! I try to use amqp sample, and when I run, I got an compilation error:

github.com/cloudevents/sdk-go/protocol/amqp/v2
..\github.com\cloudevents\sdk-go\protocol\amqp\v2\message.go:125:23: not enough arguments in call to m.AMQP.Reject
have (*amqp.Error)
want (context.Context, *amqp.Error)
..\github.com\cloudevents\sdk-go\protocol\amqp\v2\message.go:130:22: not enough arguments in call to m.AMQP.Accept
have ()
want (context.Context)

When I open message.go - I see an error in the file. This file read-only and func Finish contain errors. It's normal?

@moninCX
Copy link
Author

moninCX commented Apr 12, 2021

In the file message.go I added context.TODO() in Finish function:

func (m *Message) Finish(err error) error {
if err != nil {
return m.AMQP.Reject(context.TODO(),&amqp.Error{
Condition: condition,
Description: err.Error(),
})
}
return m.AMQP.Accept(context.TODO())
}

I'm not sure, that it correct solution, but error is gone.

@n3wscott
Copy link
Member

It seems the API on the AMQP lib have changed. https://github.com/Azure/go-amqp/releases/tag/v0.13.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants