mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-09 22:56:41 +02:00
Fix setting of extra attributes in AmqpHandler when handling batches of records (#1781)
One of content_type, content_encoding, message_id, user_id, app_id, delivery_mode, priority, timestamp, expiration, type or reply_to, headers. Co-authored-by: Попов Михаил <popov.mv@betcity.ru>
This commit is contained in:
@@ -151,13 +151,14 @@ class AmqpHandler extends AbstractProcessingHandler
|
|||||||
|
|
||||||
private function createAmqpMessage(string $data): AMQPMessage
|
private function createAmqpMessage(string $data): AMQPMessage
|
||||||
{
|
{
|
||||||
return new AMQPMessage(
|
$attributes = [
|
||||||
$data,
|
'delivery_mode' => 2,
|
||||||
[
|
'content_type' => 'application/json',
|
||||||
'delivery_mode' => 2,
|
];
|
||||||
'content_type' => 'application/json',
|
if ($this->extraAttributes) {
|
||||||
]
|
$attributes = array_merge($attributes, $this->extraAttributes);
|
||||||
);
|
}
|
||||||
|
return new AMQPMessage($data, $attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user