Search by

fittinq / symfony-exchange

fittinq

There is no license information available for the latest version (6.0.0) of this package.

This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.

Package info

gitlab.com/qlfbrands/fittinq-symfony/symfony-exchange

Issues

pkg:composer/fittinq/symfony-exchange

Statistics

Installs: 4 156

Dependents: 1

Suggesters: 0

Stars: 0

6.0.0 2026-06-20 13:59 UTC

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=