Download the PHP package ludovicose/transaction-outbox without Composer

On this page you can find all versions of the php package ludovicose/transaction-outbox. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package transaction-outbox

Laravel Pub-Sub package use transactional outbox pattern

When an event is sent to the broker, the event is stored in the database, after which the event is sent to the broker. If the event was successfully sent to the broker, we mark that the event was successfully sent.

When subscribing an event, we listen to the event from the broker. When receiving an event, we store it in the database. After saving to the database, we send an internal event for processing.

The goal of the library is to decide the consistency of data between services, the order in which the message is sent, idempotency.

Currently, the broker is Redis. In the future we will add other brokers message.

Installation

You can install the package via composer:

The package will automatically register itself.

You can publish the migration with:

After the migration has been published you can create the table by running the migrations:

You can publish the config-file with:

Usage

Publish Event

Create event file and implements by ShouldBePublish interface. If the ShouldBePublish interface is implemented, then the event automatically goes to the broker Set channel name. Channel name is the name of the event that will be sent to the broker

To send an event to the broker, you need to run the command

Subscribe

Add a channel name to the config file to understand which event to listen for. These channel names can be used as internal events.

Run command in console t listen event in broker.

Add a channel name to the EventServiceProvider file to listen for the event that came from the broker.

In handle method you get the data that came from the broker

Resubmitting events

If the event did not get into the message broker, then you can resend it with the command below, indicating the start date and end date

Http request

We can also log http requests. When sending a request, we save it with ourselves and upon receiving a response, we note that the request was successfully completed.

To register http requests, you must enable the option in the config file

Resubmitting request

If the http request failed, then it can be resent with the command below, specifying the start date and end date

Resend erroneous data from the queue

If we get an error while processing data from the queue, then this data goes to the queue (serviceName.errors).

To resend data from the queue (serviceName.errors) we need to run the command:

In the configuration file you can specify the name of the queue where the errors will be stored

Clear event in DB

If you do not clean the database from the event, then the entries in the database can increase. To clean up old entries, you can run the command:

In the config file, you can specify a day after which records will be deleted

QUEUE

Add queue.php config rabbitmq

License

The MIT License (MIT). Please see License File for more information.


All versions of transaction-outbox with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
symfony/serializer Version ^6.0
symfony/property-access Version ^6.0
php-amqplib/php-amqplib Version ^3.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ludovicose/transaction-outbox contains the following files

Loading the files please wait ....