AsyncAPI is a wrapper for Message-driven API's built on top of most used industry plugins such as PHP AMQP lib for RabbitMQ. It is built for usage altogether with AsyncAPI specs and generators
The structure for this plugin is as follows
configs/
examples/
src/
tests/
vendor/
You need to have the asyncapi/generator installed and a valid AsyncAPI specification file.
$ npm install -g @asyncapi/generator
Once you hvae the generator installed, you can try to generate code from any valid AsyncAPI file
./utilities/generate.sh -o {output} -s {sourceYamlFile}
Refer to the examples folder for further details on PHP usage
$brokerAPI = new AsyncAPI();
$factory = $brokerAPI->init();
/** @var \{{ params.packageName }}\Applications\Subscriber $subscriber */
$subscriber = $factory->createApplication(
SUBSCRIBER_KEY,
[
BROKER_HOST_KEY => 'localhost',
BROKER_USER_KEY => 'guest',
BROKER_PASSWORD_KEY => 'guest',
BROKER_PORT_KEY => '5672',
BROKER_VIRTUAL_HOST_KEY => '/',
]
);
$message = $factory->createMessage(
Example::class,
[
'id' => 1,
]
);
$subscriber->requestExampleById($message);
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
If you discover any security related issues, please email ezublena@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.