Skip to content

Commit

Permalink
fix issue on empty array
Browse files Browse the repository at this point in the history
  • Loading branch information
honarkhah committed Nov 29, 2016
1 parent 1bc0c8d commit 4600135
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/amqp.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
'connect_options' => [],
'ssl_options' => [],

'exchange_declare' => env('RABBITMQ_EXCHANGE_DECLARE', true), // create the exchange if not exists
'exchange' => 'amq.'.env('RABBITMQ_EXCHANGE_TYPE', 'direct'),
'exchange_type' => env('RABBITMQ_EXCHANGE_TYPE', 'direct'),
'exchange_passive' => env('RABBITMQ_EXCHANGE_PASSIVE', false),
Expand Down
5 changes: 4 additions & 1 deletion src/Amqp.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ public function publish($routing, $message, array $properties = [])
->setup();

$messageProperties = ['content_type' => 'text/plain', 'delivery_mode' => 2];
$messageProperties = array_merge($messageProperties, $publisher->getProperty('message_properties'));
$mP = $publisher->getProperty('message_properties');
if(!empty($mP)){
$messageProperties = array_merge($messageProperties,$mP );
}

if (is_string($message)) {
$message = new Message($message, $messageProperties);
Expand Down

0 comments on commit 4600135

Please sign in to comment.