fittinq/symfony-exchange
最新稳定版本:5.0.0
Composer 安装命令:
composer require fittinq/symfony-exchange
包简介
README 文档
README
Introduction
The Sender class is responsible for sending messages to the amq-exchange service using the Symfony HttpClient.
It facilitates communication with the exchange service, allowing you to send messages to amq-exchange
Table of contents
Installation
composer require fittinq/symfony-exchange
Usage
- Create an instance of the Sender class, providing it with the required dependencies: HttpClientInterface, TokenService, and the exchange URL.
use Fittinq\Symfony\Exchange\Sender;
use Fittinq\Symfony\Authenticator\TokenService\TokenService;
use Symfony\Contracts\HttpClient\HttpClientInterface;
$httpClient = new HttpClient(); // Replace with your actual HttpClient instance.
$tokenService = new TokenService(); // Replace with your TokenService instance.
$exchangeUrl = 'https://exchange-service-url'; // Replace with the actual exchange service URL.
$sender = new Sender($httpClient, $tokenService, $exchangeUrl);
- Use the sendToExchange method to send a message to the exchange service. Provide it with a stdClass object, a source, event, and an optional target.
$message = new stdClass();
$message->content = 'This is the message content';
$source = 'source';
$event = 'event';
$target = 'optional-target'; // You can omit this if not needed.
$sender->sendToExchange($message, $source, $event, $target);
- The sendToExchange method constructs the request and sends it to the exchange.
Configuration
Environment Variables
AMQ_EXCHANGE_HOST_URL=
统计信息
- 总下载量: 3.17k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2023-08-02