Closed marinovdf closed 7 years ago
I'he edited my config:
return [
'controllers' => [
'factories' => [
TopicProducerController::class => TopicProducerControllerFactory::class,
]
],
'dependencies' => [
Driver::class => DriverFactory::class,
'default-amqp-connection' => [ConnectionFactory::class, 'default'],
'opm-consumer' => [CallbackConsumerFactory::class, 'opm-consumer'],
'opm-producer' => [ProducerFactory::class, 'opm-producer'],
'mail-callback' => MailCallbackFactory::class
],
'humus' => [
'amqp' => [
'driver' => Driver::AMQP_EXTENSION,
'connection' => [
'default' => [
'host' => 'localhost',
'port' => 5672,
'login' => 'guest',
'password' => 'guest',
'vhost' => '/',
'persistent' => false,
'read_timeout' => 3,
'write_timeout' => 1
],
],
'exchange' => [
'opm-exchange' => [
'name' => 'opm-exchange',
'type' => 'direct',
'connection' => 'default-amqp-connection',
'auto_setup_fabric' => true,
]
],
'producer' => [
'opm-producer' => [
'exchange' => 'opm-exchange',
'qos' => [
'prefetch_size' => 0,
'prefetch_count' => 10
],
'auto_setup_fabric' => true
],
],
'queue' => [
'opm-mail' => [
'name' => 'opm-mail',
'exchanges' => [
'opm-exchange' => []
],
'connection' => 'default-amqp-connection'
],
],
'callback_consumer' => [
'opm-consumer' => [
'queue' => 'opm-queue',
'idle_timeout' => 12.5,
'consumer_tag' => 'opm-consumer-tag',
'qos' => [
'prefetch_count' => 50,
],
],
],
]
],
];
after run vendor/bin/humus-amqp-module setup-fabric
fabric successfully installed.
But after run vendor/bin/humus-amqp-module consumer -c opm-consumer
I see No consumer with name opm-consumer found
.
First note that
TopicProducerController::class => TopicProducerControllerFactory::class
is no more available.
Second, it should look like this:
'dependencies' => [
'factories' => [
// your factories here
]
]
It looks to me you put your factories not in the factories subconfig of dependencies
.
Oh, yes, I've moved my factories to the factories subconfig, but still consumer does not found:
vagrant@host:/var/www$ vendor/bin/humus-amqp-module consumer -c opm-consumer
No consumer with name opm-consumer found
Maybe you have a small example?
There are examples in the documentation.
On May 30, 2017 18:50, "Dmitry Marinov" notifications@github.com wrote:
Maybe you have a small example?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/prolic/HumusAmqpModule/issues/43#issuecomment-304842561, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYEvMQKdTKPzIz_HGiGz0OAKqx0orvdks5r-_RggaJpZM4NpSJ- .
@prolic , thanks for your answers! My working config for ZF3 looks something like this (maybe someone will need):
return [
'service_manager' => [
'factories' => [
Driver::class => DriverFactory::class,
'default-amqp-connection' => [ConnectionFactory::class, 'default-amqp-connection'],
'some-producer' => [ProducerFactory::class, 'some-producer'],
'some-consumer' => [CallbackConsumerFactory::class, 'some-consumer'],
MailCallback::class => MailCallbackFactory::class,
]
],
'humus' => [
'amqp' => [
'driver' => Driver::PHP_AMQP_LIB,
'connection' => [
'default-amqp-connection' => [
'type' => 'socket', // only for php-amqplib driver
'host' => 'localhost',
'port' => 5672,
'login' => 'guest',
'password' => 'guest',
'vhost' => '/',
'persistent' => false,
'read_timeout' => 3,
'write_timeout' => 1
],
],
'exchange' => [
'some-exchange' => [
'name' => 'some-exchange',
'type' => 'direct',
'connection' => 'default-amqp-connection',
'auto_setup_fabric' => true,
]
],
'producer' => [
'some-producer' => [
'type' => 'json',
'exchange' => 'some-exchange',
'qos' => [
'prefetch_size' => 0,
'prefetch_count' => 10
],
'auto_setup_fabric' => true
],
],
'queue' => [
'some-mail' => [
'name' => 'opm-mail',
'exchanges' => [
'some-exchange' => []
],
'connection' => 'default-amqp-connection'
],
],
'callback_consumer' => [
'some-consumer' => [
'queue' => 'some-mail',
'delivery_callback' => MailCallback::class,
'idle_timeout' => 10,
'consumer_tag' => 'opm-consumer-tag',
],
],
]
],
];
The issue can be closed
I have migrated my app from ZF2 to ZF3, but HumusAmqpModule now is not working. I had version
v0.3.1
before and config like this:After migration my composer.json looks like that:
Also in
application.config.php
inmodules
section addedHumusAmqpModule
What I need to change to make everything work. Thanks.