Skip to content

Commit ea79f3d

Browse files
authored
Merge pull request #64 from chadicus/master
Include machineName in message document
2 parents 08e6d6a + 0218e48 commit ea79f3d

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ before_script:
1616
- yes '' | pecl install -f mongodb
1717
- composer update $PREFER_LOWEST
1818
script: ./vendor/bin/phpunit --coverage-clover clover.xml
19-
after_success: ./vendor/bin/coveralls -v
19+
after_success: ./vendor/bin/php-coveralls -v

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@
2525
},
2626
"require": {
2727
"php": "^7.0",
28-
"mongodb/mongodb": "^1.1"
28+
"ext-mongodb": "*",
29+
"mongodb/mongodb": "^1.1"
2930
},
3031
"require-dev": {
32+
"php-coveralls/php-coveralls": "^2.2",
3133
"phpunit/phpunit": "^6.5.2",
32-
"php-coveralls/php-coveralls": "^1.0",
3334
"squizlabs/php_codesniffer": "^3.2"
3435
},
3536
"autoload": {

src/AbstractQueue.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ final public function requeue(Message $message)
226226
'payload' => $message->getPayload(),
227227
'earliestGet' => $message->getEarliestGet(),
228228
'priority' => $message->getPriority(),
229+
'machineName' => gethostname(),
229230
'created' => new UTCDateTime(),
230231
];
231232

@@ -246,6 +247,7 @@ final public function send(Message $message)
246247
'payload' => $message->getPayload(),
247248
'earliestGet' => $message->getEarliestGet(),
248249
'priority' => $message->getPriority(),
250+
'machineName' => gethostname(),
249251
'created' => new UTCDateTime(),
250252
];
251253

tests/QueueTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,7 @@ private function assertSingleMessage(Message $expected)
511511
$this->assertSame((string)$expected->getId(), (string)$actual['_id']);
512512
$this->assertSame($expected->getPayload(), $actual['payload']);
513513
$this->assertSame($expected->getPriority(), $actual['priority']);
514+
$this->assertSame(gethostname(), $actual['machineName']);
514515
$this->assertEquals($expected->getEarliestGet(), $actual['earliestGet']);
515516
}
516517

0 commit comments

Comments
 (0)