PHPackages                             spryker-sdk/async-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. spryker-sdk/async-api

ActiveLibrary

spryker-sdk/async-api
=====================

SDK for AsyncAPI.

0.3.3(1y ago)2670.1k—2.1%18proprietaryPHPPHP &gt;=8.0

Since Jan 26Pushed 1y ago9 watchersCompare

[ Source](https://github.com/spryker-sdk/async-api)[ Packagist](https://packagist.org/packages/spryker-sdk/async-api)[ RSS](/packages/spryker-sdk-async-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (12)Versions (16)Used By (8)

AsyncApi
========

[](#asyncapi)

[![Build Status](https://github.com/spryker-sdk/async-api/workflows/CI/badge.svg?branch=master)](https://github.com/spryker-sdk/async-api/actions?query=workflow%3ACI+branch%3Amaster)[![Latest Stable Version](https://camo.githubusercontent.com/39fdc80e72462eeff17c9453c765246e4830e0420948760242935add4a68a159/68747470733a2f2f706f7365722e707567782e6f72672f737072796b65722d73646b2f6173796e632d6170692f762f737461626c652e737667)](https://packagist.org/packages/spryker-sdk/async-api)[![Minimum PHP Version](https://camo.githubusercontent.com/0e9ac047546796cfdbe1423d1f4d91c8f37d2fbb11614a7900bb7686aaa5401f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e342d3838393242462e737667)](https://php.net/)[![PHPStan](https://camo.githubusercontent.com/f60d96f7c2579690ab6dfa8918f777fe93a02a92301c661eb38a85861a92b780/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230382d627269676874677265656e2e7376673f7374796c653d666c6174)](https://phpstan.org/)

This library provides an AsyncAPI parser.

Installation
------------

[](#installation)

- `composer require --dev spryker-sdk/async-api`

Usage
-----

[](#usage)

### Parsing an AsyncAPI file

[](#parsing-an-asyncapi-file)

```
use SprykerSdk\AsyncApi\AsyncApi\Loader\AsyncApiLoader;

$asyncApiLoader = new AsyncApiLoader();
$asyncApi = $asyncApiLoader->load('.../path/to/async-api.yml');

// Get the channel(s)
$channels = $asyncApi->getChannels();
$channel = $asyncApi->getChannel('channel-name');

// Get publish message(s)
$publishMessages = $channel->getPublishMessages();
$publishMessage = $channel->getPublishMessage('message-name');

// Get subscribe message(s)
$subscribeMessages = $channel->getSubscribeMessages();
$subscribeMessage = $channel->getSubscribeMessage('message-name');

// Get message detail(s)
$messageAttributes = $subscribeMessage->getAttributes();
$messageAttribute = $subscribeMessage->getAttribute('attribute-name');
```

### Run tests/checks

[](#run-testschecks)

- `composer test` - This will execute the tests.
- `composer cs-check` - This will run CodeStyle checks.
- `composer cs-fix` - This will fix fixable CodeStyles.
- `composer stan` - This will run PHPStan checks.

Documentation

The following console commands are available:

- `vendor/bin/asyncapi schema:asyncapi:create`
- `vendor/bin/asyncapi schema:asyncapi:message:add`
- `vendor/bin/asyncapi schema:asyncapi:validate`
- `vendor/bin/asyncapi code:asyncapi:generate`

Adding an AsyncAPI file
-----------------------

[](#adding-an-asyncapi-file)

The `vendor/bin/asyncapi schema:asyncapi:create` adds a minimal AsyncAPI file.

### Arguments and Options

[](#arguments-and-options)

#### Arguments

[](#arguments)

- `title`

`vendor/bin/asyncapi schema:asyncapi:create "Your Async API title"` will set the title in your AsyncAPI file.

```
...
info:
    title: 'Your Async API title'
...

```

#### Options

[](#options)

- `asyncapi-file`
- `api-version`

`vendor/bin/asyncapi schema:asyncapi:create --asyncapi-file "path/to/async-api.yml"` will override the default file location (resources/api/asyncapi.yml).

`vendor/bin/asyncapi schema:asyncapi:create --api-version 1.0.0` will override the default file version (0.1.0).

Adding a message to an AsyncAPI file
------------------------------------

[](#adding-a-message-to-an-asyncapi-file)

The `vendor/bin/asyncapi schema:asyncapi:message:add` adds a message to a given AsyncAPI file. This command can also be used to reverse engineer from an existing Transfer object.

This console command has many options to be configured. See all of them by running

`vendor/bin/asyncapi schema:asyncapi:message:add -h`

it will print a help page for this command.

### Adding a subscribe message

[](#adding-a-subscribe-message)

To subscribe to messages from a specific channel you need to run the command as following:

`vendor/bin/asyncapi schema:asyncapi:message:add foo-bar ZipZap ModuleName -e subscribe -P propertyA:string -P propertyB:int`

This will add a subscribe section to the given AsyncAPI schema file that describes that sent messages with the name "ZipZap" that are sent over the channel "foo-bar" and that you sent the properties "propertyA of type string" and "propertyB of type int".

You can now create code from this definition.

### Adding a publish message

[](#adding-a-publish-message)

To receive messages from a specific channel you need to run the command as following:

`vendor/bin/asyncapi schema:asyncapi:message:add foo-bar ZipZap ModuleName -e publish -P propertyA:string -P propertyB:int`

This will add a publish section to the given AsyncAPI schema file that describes that you want to receive messages with the name "ZipZap" that are sent over the channel "foo-bar" and that you want to use the properties "propertyA of type string" and "propertyB of type int".

You can now create code from this definition.

### Reverse Engineer from given Transfer

[](#reverse-engineer-from-given-transfer)

Validating an AsyncAPI file
---------------------------

[](#validating-an-asyncapi-file)

The `vendor/bin/asyncapi schema:asyncapi:validate` validates a given AsyncAPI file.

Create code from an existing AsyncAPI
-------------------------------------

[](#create-code-from-an-existing-asyncapi)

The `vendor/bin/asyncapi code:asyncapi:generate` reads an existing AsyncAPI file and creates code out of it. This command creates:

- Message Transfer definitions (XML)
- Adds handler for Messages that are sent to the application

#### Options

[](#options-1)

- `asyncapi-file`, can be used to run the generator with a specific AsyncAPI file
- `organization`, can be used to set a specific organization, when set to Spryker code will be generated in the core modules (default: App)

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~63 days

Recently: every ~122 days

Total

15

Last Release

683d ago

PHP version history (2 changes)0.1.0PHP &gt;=7.4

0.2.8PHP &gt;=8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10738957?v=4)[Spryker Bot](/maintainers/spryker-bot)[@spryker-bot](https://github.com/spryker-bot)

---

Top Contributors

[![stereomon](https://avatars.githubusercontent.com/u/1382877?v=4)](https://github.com/stereomon "stereomon (53 commits)")[![danielsantos-spryker](https://avatars.githubusercontent.com/u/117193368?v=4)](https://github.com/danielsantos-spryker "danielsantos-spryker (16 commits)")[![miroshnikov-spryker](https://avatars.githubusercontent.com/u/94458630?v=4)](https://github.com/miroshnikov-spryker "miroshnikov-spryker (15 commits)")[![vol4onok](https://avatars.githubusercontent.com/u/5063777?v=4)](https://github.com/vol4onok "vol4onok (13 commits)")[![dereuromark](https://avatars.githubusercontent.com/u/39854?v=4)](https://github.com/dereuromark "dereuromark (6 commits)")[![spryker-release-bot](https://avatars.githubusercontent.com/u/26904324?v=4)](https://github.com/spryker-release-bot "spryker-release-bot (4 commits)")[![geega](https://avatars.githubusercontent.com/u/1426310?v=4)](https://github.com/geega "geega (3 commits)")[![jfernandezsw](https://avatars.githubusercontent.com/u/83318802?v=4)](https://github.com/jfernandezsw "jfernandezsw (1 commits)")[![gechetspr](https://avatars.githubusercontent.com/u/42143273?v=4)](https://github.com/gechetspr "gechetspr (1 commits)")

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/spryker-sdk-async-api/health.svg)

```
[![Health](https://phpackages.com/badges/spryker-sdk-async-api/health.svg)](https://phpackages.com/packages/spryker-sdk-async-api)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.7k509.9M17.0k](/packages/laravel-framework)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
