-
Notifications
You must be signed in to change notification settings - Fork 437
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
[SQS] add messageId to the sqsMessage #992
[SQS] add messageId to the sqsMessage #992
Conversation
pkg/sqs/SqsConsumer.php
Outdated
@@ -185,6 +185,10 @@ protected function convertMessage(array $sqsMessage): SqsMessage | |||
{ | |||
$message = $this->context->createMessage(); | |||
|
|||
if (isset($sqsMessage['MessageId'])) { |
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.
No need for if. As far as I can see the field is there all the time.
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.
@makasim ok, i've update my code to remove the isset check and have also move the setMessage call to the end of the function, because the setHeader is overriding the message_id header value
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.
The if
is still there, isn't it? Should be removed as the MessageId
is always there.
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.
oups, my bad i was sure to have pushed the deletion on this if
7d7b76b
to
d6eb41a
Compare
@makasim any news about this pull request ? |
d6559f6
to
f8a458d
Compare
@@ -337,7 +338,7 @@ public function testShouldReceiveMessage() | |||
|
|||
$this->assertInstanceOf(SqsMessage::class, $result); | |||
$this->assertEquals('The Body', $result->getBody()); | |||
$this->assertEquals(['hkey' => 'hvalue'], $result->getHeaders()); | |||
$this->assertEquals(['hkey' => 'hvalue', 'message_id' => 'theMessageId'], $result->getHeaders()); |
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.
message_id
should not be a part of headers. That was wrong to put it there. Could you please create and use a dedicated property for it in Message class.
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.
If I change this, we will need to change this in all the other message type as we are reusing the test between services
This reverts commit f2bd9db.
Hi,
I saw that we are not allowing user to access the messageId of a sqs message.
following the issue #837 i have added the messageId in the convertMessage method.