-
Notifications
You must be signed in to change notification settings - Fork 2
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
SD-103813 | implementation of the SQS receive message #28
Conversation
res, err := q.client.ReceiveMessage(context.Background(), input) | ||
|
||
if err != 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.
res, err := q.client.ReceiveMessage(context.Background(), input) | |
if err != nil { | |
res, err := q.client.ReceiveMessage(context.Background(), input) | |
if err != nil { |
in styling-wise, we prefer handling error directly with no new line between
inssqs/inssqs.go
Outdated
input := &awssqs.ReceiveMessageInput{ | ||
QueueUrl: q.url, | ||
MaxNumberOfMessages: maxMessages, | ||
VisibilityTimeout: visibilityTimeout, |
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.
isn't there a validation rule that we can apply to the visibilityTimeout
like we did to maxMessages
?
@@ -61,6 +61,9 @@ if err != nil { | |||
} | |||
``` | |||
|
|||
### Receiving Messages | |||
Receive batch of messages from SQS queue using `ReceiveMessageBatch()` | |||
|
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.
code example below would be nice like examples above
// - err: An error indicating any failure during the receiving process, nil if all messages were received successfully. | ||
func (q *queue) ReceiveMessageBatch(rmi ReceiveMessageInput) (ReceiveMessageOutput, error) { | ||
if rmi.MaxNumberOfMessages > 10 { | ||
return ReceiveMessageOutput{}, fmt.Errorf("maxMessages should be less than or equal to 10") |
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.
fmt.Errorf is redundant here, formating isn't used. we can use errors.New
in inssqs/errors.go
// - rmi: ReceiveMessageInput containing the parameters for receiving messages from the SQS queue. | ||
// | ||
// Returns: | ||
// - res: A pointer to ReceiveMessageOutput containing the received messages. |
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.
doesn't return the pointer
// - err: An error indicating any failure during the receiving process, nil if all messages were received successfully. | ||
func (q *queue) ReceiveMessageBatch(rmi ReceiveMessageInput) (ReceiveMessageOutput, error) { | ||
if rmi.MaxNumberOfMessages > 10 { | ||
return ReceiveMessageOutput{}, fmt.Errorf("maxMessages should be less than or equal to 10") |
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.
return ReceiveMessageOutput{}, fmt.Errorf("maxMessages should be less than or equal to 10") | |
return ReceiveMessageOutput{}, fmt.Errorf("MaxNumberOfMessages should be less than or equal to 10") |
No description provided.