Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update async-topics.md #304

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ Sort order is set to 0 by default. This allows developers to change some aspects

`\Magento\Framework\Communication\Config\CompositeReader::read()` collects configuration records from defined readers and merges these records into a single configurataion.

Because the generation of thge topics configuration is based on schema type, the generated `<topic>` XML is returned with `"sync"=true`. The `response` attribut is based on the service response definition. So the `WebapiAsync` module changes those settings to `"sync"=false` and `response` is set to null. These changes will allow the application to execute topics asynchronously.
Because the generation of the topics configuration is based on schema type, the generated `<topic>` XML is returned with `"sync"=true`. The `response` attribute is based on the service response definition. So the `WebapiAsync` module changes those settings to `"sync"=false` and `response` is set to null. These changes will allow the application to execute topics asynchronously.

## Topics generation

Asynchronous and Bulk APIs are built on top of the standard Rest API. Topics for message processing fo asynchronous and bulk APIs are generated automatically, together with the `communication.xml` schema. This is done by `\Magento\WebapiAsync\Model\Config::getServices()`. The current method is responsible for retrieving all service contracts defined in `webapi.xml` files and generates topic names for the corresponding asynchronous requests.
Asynchronous and Bulk APIs are built on top of the standard Rest API. Topics for message processing for asynchronous and bulk APIs are generated automatically, together with the `communication.xml` schema. This is done by `\Magento\WebapiAsync\Model\Config::getServices()`. The current method is responsible for retrieving all service contracts defined in `webapi.xml` files and generates topic names for the corresponding asynchronous requests.

`generateTopicNameFromService($serviceInterface, $serviceMethod, $httpMethod)` is responsible for generating a topic name based on the service contract interface, the service contract method, and the HTTP method.

Expand All @@ -66,4 +66,4 @@ It consists of following parts:
* lower cased service method
* lover cased http method

Unfortunately, there are no easy way to get a list of all generated topic names, but knowing this pattern, developers can find the required topic name and use it for executing service contracts in asynchronously.
Unfortunately, there is no easy way to get a list of all generated topic names, but knowing this pattern, developers can find the required topic name and use it for executing service contracts in asynchronously.
Loading