Skip to content

Multi Transport Simple Client #75

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
merged 8 commits into from
May 10, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"enqueue/sqs": "*@dev",
"enqueue/enqueue-bundle": "*@dev",
"enqueue/job-queue": "*@dev",
"enqueue/simple-client": "*@dev",
"enqueue/test": "*@dev",

"phpunit/phpunit": "^5",
Expand Down Expand Up @@ -77,6 +78,10 @@
{
"type": "path",
"url": "pkg/sqs"
},
{
"type": "path",
"url": "pkg/simple-client"
}
]
}
4 changes: 4 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
<testsuite name="job-queue">
<directory>pkg/job-queue/Tests</directory>
</testsuite>

<testsuite name="simple-client">
<directory>pkg/simple-client/Tests</directory>
</testsuite>
</testsuites>

<filter>
Expand Down
174 changes: 0 additions & 174 deletions pkg/enqueue/Client/SimpleClient.php

This file was deleted.

19 changes: 16 additions & 3 deletions pkg/enqueue/Tests/Functional/Client/RpcClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Enqueue\AmqpExt\AmqpContext;
use Enqueue\Client\RpcClient;
use Enqueue\Client\SimpleClient;
use Enqueue\SimpleClient\SimpleClient;
use Enqueue\Consumption\ChainExtension;
use Enqueue\Consumption\Extension\LimitConsumedMessagesExtension;
use Enqueue\Consumption\Extension\LimitConsumptionTimeExtension;
Expand Down Expand Up @@ -39,14 +39,27 @@ public function setUp()
$this->context = $this->buildAmqpContext();
$this->replyContext = $this->buildAmqpContext();

$this->removeQueue('default');
$this->removeQueue('enqueue.app.default');
}

public function testProduceAndConsumeOneMessage()
{
$config = [
'transport' => [
'rabbitmq_amqp' => [
'host' => getenv('SYMFONY__RABBITMQ__HOST'),
'port' => getenv('SYMFONY__RABBITMQ__AMQP__PORT'),
'login' => getenv('SYMFONY__RABBITMQ__USER'),
'password' => getenv('SYMFONY__RABBITMQ__PASSWORD'),
'vhost' => getenv('SYMFONY__RABBITMQ__VHOST'),
],
],
];

$requestMessage = null;

$client = new SimpleClient($this->context);
$client = new SimpleClient($config);
$client->setupBroker();
$client->bind('foo_topic', 'foo_processor', function (PsrMessage $message, PsrContext $context) use (&$requestMessage) {
$requestMessage = $message;

Expand Down
83 changes: 0 additions & 83 deletions pkg/enqueue/Tests/Functional/Client/SimpleClientTest.php

This file was deleted.

6 changes: 4 additions & 2 deletions pkg/enqueue/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"symfony/dependency-injection": "^2.8|^3",
"symfony/config": "^2.8|^3",
"enqueue/null": "^0.3",
"enqueue/test": "^0.3"
"enqueue/test": "^0.3",
"enqueue/simple-client": "^0.3"
Copy link
Member

Choose a reason for hiding this comment

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

IMO enqueue should not require simple client. Why do you think we should do?

},
"suggest": {
"symfony/console": "^2.8|^3 If you want to use li commands",
Expand All @@ -31,7 +32,8 @@
"enqueue/stomp": "STOMP transport",
"enqueue/fs": "Filesystem transport",
"enqueue/redis": "Redis transport",
"enqueue/dbal": "Doctrine DBAL transport"
"enqueue/dbal": "Doctrine DBAL transport",
"enqueue/sqs": "Amazon AWS SQS transport"
},
"autoload": {
"psr-4": { "Enqueue\\": "" },
Expand Down
6 changes: 6 additions & 0 deletions pkg/simple-client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*~
/composer.lock
/composer.phar
/phpunit.xml
/vendor/
/.idea/
21 changes: 21 additions & 0 deletions pkg/simple-client/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
sudo: false

git:
depth: 1

language: php

php:
- '5.6'
- '7.0'

cache:
directories:
- $HOME/.composer/cache

install:
- composer self-update
- composer install --prefer-source

script:
- vendor/bin/phpunit --exclude-group=functional
Loading