mirror of
https://github.com/wallabag/wallabag.git
synced 2025-01-09 08:25:25 +00:00
AMPQ -> AMQP
This commit is contained in:
parent
a622fbc444
commit
ac87e0db2a
4 changed files with 18 additions and 18 deletions
|
@ -254,7 +254,7 @@ old_sound_rabbit_mq:
|
||||||
type: topic
|
type: topic
|
||||||
queue_options:
|
queue_options:
|
||||||
name: 'wallabag.import.pocket'
|
name: 'wallabag.import.pocket'
|
||||||
callback: wallabag_import.consumer.ampq.pocket
|
callback: wallabag_import.consumer.amqp.pocket
|
||||||
import_readability:
|
import_readability:
|
||||||
connection: default
|
connection: default
|
||||||
exchange_options:
|
exchange_options:
|
||||||
|
@ -262,7 +262,7 @@ old_sound_rabbit_mq:
|
||||||
type: topic
|
type: topic
|
||||||
queue_options:
|
queue_options:
|
||||||
name: 'wallabag.import.readability'
|
name: 'wallabag.import.readability'
|
||||||
callback: wallabag_import.consumer.ampq.readability
|
callback: wallabag_import.consumer.amqp.readability
|
||||||
import_wallabag_v1:
|
import_wallabag_v1:
|
||||||
connection: default
|
connection: default
|
||||||
exchange_options:
|
exchange_options:
|
||||||
|
@ -270,7 +270,7 @@ old_sound_rabbit_mq:
|
||||||
type: topic
|
type: topic
|
||||||
queue_options:
|
queue_options:
|
||||||
name: 'wallabag.import.wallabag_v1'
|
name: 'wallabag.import.wallabag_v1'
|
||||||
callback: wallabag_import.consumer.ampq.wallabag_v1
|
callback: wallabag_import.consumer.amqp.wallabag_v1
|
||||||
import_wallabag_v2:
|
import_wallabag_v2:
|
||||||
connection: default
|
connection: default
|
||||||
exchange_options:
|
exchange_options:
|
||||||
|
@ -278,4 +278,4 @@ old_sound_rabbit_mq:
|
||||||
type: topic
|
type: topic
|
||||||
queue_options:
|
queue_options:
|
||||||
name: 'wallabag.import.wallabag_v2'
|
name: 'wallabag.import.wallabag_v2'
|
||||||
callback: wallabag_import.consumer.ampq.wallabag_v2
|
callback: wallabag_import.consumer.amqp.wallabag_v2
|
||||||
|
|
|
@ -5,7 +5,7 @@ namespace Wallabag\ImportBundle\Consumer;
|
||||||
use OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface;
|
use OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface;
|
||||||
use PhpAmqpLib\Message\AMQPMessage;
|
use PhpAmqpLib\Message\AMQPMessage;
|
||||||
|
|
||||||
class AMPQEntryConsumer extends AbstractConsumer implements ConsumerInterface
|
class AMQPEntryConsumer extends AbstractConsumer implements ConsumerInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
|
@ -1,28 +1,28 @@
|
||||||
# RabbitMQ stuff
|
# RabbitMQ stuff
|
||||||
services:
|
services:
|
||||||
wallabag_import.consumer.ampq.pocket:
|
wallabag_import.consumer.amqp.pocket:
|
||||||
class: Wallabag\ImportBundle\Consumer\AMPQEntryConsumer
|
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
|
||||||
arguments:
|
arguments:
|
||||||
- "@doctrine.orm.entity_manager"
|
- "@doctrine.orm.entity_manager"
|
||||||
- "@wallabag_user.user_repository"
|
- "@wallabag_user.user_repository"
|
||||||
- "@wallabag_import.pocket.import"
|
- "@wallabag_import.pocket.import"
|
||||||
- "@logger"
|
- "@logger"
|
||||||
wallabag_import.consumer.ampq.readability:
|
wallabag_import.consumer.amqp.readability:
|
||||||
class: Wallabag\ImportBundle\Consumer\AMPQEntryConsumer
|
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
|
||||||
arguments:
|
arguments:
|
||||||
- "@doctrine.orm.entity_manager"
|
- "@doctrine.orm.entity_manager"
|
||||||
- "@wallabag_user.user_repository"
|
- "@wallabag_user.user_repository"
|
||||||
- "@wallabag_import.readability.import"
|
- "@wallabag_import.readability.import"
|
||||||
- "@logger"
|
- "@logger"
|
||||||
wallabag_import.consumer.ampq.wallabag_v1:
|
wallabag_import.consumer.amqp.wallabag_v1:
|
||||||
class: Wallabag\ImportBundle\Consumer\AMPQEntryConsumer
|
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
|
||||||
arguments:
|
arguments:
|
||||||
- "@doctrine.orm.entity_manager"
|
- "@doctrine.orm.entity_manager"
|
||||||
- "@wallabag_user.user_repository"
|
- "@wallabag_user.user_repository"
|
||||||
- "@wallabag_import.wallabag_v1.import"
|
- "@wallabag_import.wallabag_v1.import"
|
||||||
- "@logger"
|
- "@logger"
|
||||||
wallabag_import.consumer.ampq.wallabag_v2:
|
wallabag_import.consumer.amqp.wallabag_v2:
|
||||||
class: Wallabag\ImportBundle\Consumer\AMPQEntryConsumer
|
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
|
||||||
arguments:
|
arguments:
|
||||||
- "@doctrine.orm.entity_manager"
|
- "@doctrine.orm.entity_manager"
|
||||||
- "@wallabag_user.user_repository"
|
- "@wallabag_user.user_repository"
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
|
|
||||||
namespace Tests\Wallabag\ImportBundle\Consumer\AMQP;
|
namespace Tests\Wallabag\ImportBundle\Consumer\AMQP;
|
||||||
|
|
||||||
use Wallabag\ImportBundle\Consumer\AMPQEntryConsumer;
|
use Wallabag\ImportBundle\Consumer\AMQPEntryConsumer;
|
||||||
use PhpAmqpLib\Message\AMQPMessage;
|
use PhpAmqpLib\Message\AMQPMessage;
|
||||||
use Wallabag\UserBundle\Entity\User;
|
use Wallabag\UserBundle\Entity\User;
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
|
|
||||||
class AMPQEntryConsumerTest extends \PHPUnit_Framework_TestCase
|
class AMQPEntryConsumerTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
public function testMessageOk()
|
public function testMessageOk()
|
||||||
{
|
{
|
||||||
|
@ -112,7 +112,7 @@ JSON;
|
||||||
->with(json_decode($body, true))
|
->with(json_decode($body, true))
|
||||||
->willReturn($entry);
|
->willReturn($entry);
|
||||||
|
|
||||||
$consumer = new AMPQEntryConsumer(
|
$consumer = new AMQPEntryConsumer(
|
||||||
$em,
|
$em,
|
||||||
$userRepository,
|
$userRepository,
|
||||||
$import
|
$import
|
||||||
|
@ -157,7 +157,7 @@ JSON;
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$consumer = new AMPQEntryConsumer(
|
$consumer = new AMQPEntryConsumer(
|
||||||
$em,
|
$em,
|
||||||
$userRepository,
|
$userRepository,
|
||||||
$import
|
$import
|
||||||
|
@ -212,7 +212,7 @@ JSON;
|
||||||
->with(json_decode($body, true))
|
->with(json_decode($body, true))
|
||||||
->willReturn(null);
|
->willReturn(null);
|
||||||
|
|
||||||
$consumer = new AMPQEntryConsumer(
|
$consumer = new AMQPEntryConsumer(
|
||||||
$em,
|
$em,
|
||||||
$userRepository,
|
$userRepository,
|
||||||
$import
|
$import
|
Loading…
Reference in a new issue