Skip to content

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

$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 Tobion and fabpot 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