Skip to content

Migration from ZF2 to ZF3 #43

@marinovdf

Description

@marinovdf

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:

return [
    'controllers' => [
        'factories' => [
            TopicProducerController::class => TopicProducerControllerFactory::class,
        ]
    ],

    'humus_amqp_module' => [
        'exchanges' => [
            'opm-exchange' => [
                'name' => 'opm-exchange',
                'type' => 'direct',
                'arguments' => [],
            ],
            'demo.error' => [
                'name' => 'demo.error',
                'type' => 'direct',
                'arguments' => [],
            ],
        ],
        'queues' => [
            'opm-mail' => [
                'name' => 'opm-mail-queue',
                'exchange' => 'opm-exchange',
                'routing_keys' => [],
                'arguments' => [
                    'x-dead-letter-exchange' => 'demo.error' // must be defined as exchange before
                ],
                'bind_arguments' => [],
            ],
        ],
        'connections' => [
            'default' => [
                'host' => 'localhost',
                'port' => 5672,
                'login' => 'guest',
                'password' => 'guest',
                'vhost' => '/',
                'persistent' => true,
                'read_timeout' => 1, //sec, float allowed
                'write_timeout' => 1, //sec, float allowed
            ],
        ],
        'producers' => [
            'opm-producer' => [
                'exchange' => 'opm-exchange',
                'qos' => [
                    'prefetch_size' => 0,
                    'prefetch_count' => 10
                ],
                'auto_setup_fabric' => true
            ],
        ],
        'consumers' => [
            'opm-consumer' => [
                'queues' => [
                    'opm-mail'
                ],
                'auto_setup_fabric' => true,
                'callback' => 'mail',
                'idle_timeout' => 10,
                'logger' => 'consumer-logger',
                'error_callback' => 'errorcallback'
            ],
        ],

        'plugin_managers' => [
            'callback' => [
                'invokables' => [
                    'echo'          => EchoCallback::class,
                    'error'         => EchoErrorCallback::class,
                    'poweroftwo'    => PowerOfTwoCallback::class,
                    'randomint'     => RandomIntCallback::class,
                    'errorcallback' => ErrorCallback::class,
                ],

                'factories' => [
                    'mail' => MailCallbackFactory::class
                ]
            ]
        ]
    ],
];

After migration my composer.json looks like that:

{
  "require": {
    "php": "~7.0",
    "ext-amqp": ">=1.7.0",
    "ext-zip": "*",
    "ext-intl": "*",
    "ext-mbstring": "*",
    "ext-gd": "*",
    "ext-xml": "*",
    "ext-curl": "*",
    "ext-bcmath": "*",
    "roave/security-advisories": "dev-master",
    "zendframework/zendframework": "^3.0",
    "zendframework/zend-mvc-console": "^1.1",
    "phpoffice/phpexcel": "dev-master",
    "imagine/Imagine": "dev-master",
    "php-amqplib/php-amqplib": "2.6.2",
    "prolic/humus-amqp": "^1.1",
    "prolic/humus-amqp-module": "^1.0",
    ...
  }
}

Also in application.config.php in modules section added HumusAmqpModule

What I need to change to make everything work.
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions