Skip to content

[Messenger] Add message timestamp to amqp connection #37867

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

Merged

Conversation

bzajacc
Copy link

@bzajacc bzajacc commented Aug 17, 2020

Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? no
Tickets none
License MIT
Doc PR none

Add default timestamp to amqp transport message.

It is useful when you logging each message, and your consumer is down, you alway get right message time when start consume again.

@bzajacc bzajacc force-pushed the feature/add-timestamp-to-amqp-messages branch from f4be339 to 53cb6a8 Compare August 18, 2020 05:57
@@ -266,7 +267,7 @@ public function testItSetupsTheConnectionWithDefaults()
);

$amqpExchange->expects($this->once())->method('declareExchange');
$amqpExchange->expects($this->once())->method('publish')->with('body', null, AMQP_NOPARAM, ['headers' => [], 'delivery_mode' => 2]);
$amqpExchange->expects($this->once())->method('publish')->with('body', null, AMQP_NOPARAM, ['headers' => [], 'delivery_mode' => 2, 'timestamp' => ClockMock::time()]);
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 using ClockMock directly, you should use a @group time-sensitive annotation on the test class itself.

Copy link
Author

Choose a reason for hiding this comment

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

Yeah I see now, fixed :)

@bzajacc bzajacc force-pushed the feature/add-timestamp-to-amqp-messages branch from 53cb6a8 to 9c3989b Compare August 18, 2020 06:19
@bzajacc bzajacc force-pushed the feature/add-timestamp-to-amqp-messages branch from 9c3989b to 281540e Compare August 18, 2020 06:19
@bzajacc bzajacc requested review from fabpot and Tobion August 18, 2020 06:24
@fabpot
Copy link
Member

fabpot commented Aug 18, 2020

Thank you @bzajacc.

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

Successfully merging this pull request may close these issues.

4 participants