定制 fittinq/symfony-exchange 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

  1. 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);
  1. 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);
  1. 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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2023-08-02