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

SD-103813 | implementation of the SQS receive message #28

Closed
wants to merge 3 commits into from

Conversation

dogukanayd
Copy link
Member

No description provided.

@dogukanayd dogukanayd self-assigned this Apr 15, 2024
Comment on lines +146 to +148
res, err := q.client.ReceiveMessage(context.Background(), input)

if err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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,
Copy link
Collaborator

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()`

Copy link
Collaborator

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")
Copy link
Collaborator

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.
Copy link
Collaborator

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")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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")

@dogukanayd dogukanayd closed this May 6, 2024
@dogukanayd dogukanayd deleted the feature/SD-103813 branch May 6, 2024 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants