Download the PHP package it-bens/message-bus-redirect-bundle without Composer

On this page you can find all versions of the php package it-bens/message-bus-redirect-bundle. 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 message-bus-redirect-bundle

The Message Bus Redirect Bundle

There are some bundles that cannot handle multiple buses in one application. That can be a problem if commands or queries should be passed to different buses. This bundle can redirect envelops of the Symfony messenger from one bus to another by using a middleware.

How to install the bundle?

The package can be installed via Composer:

If you're using Symfony Flex, the bundle will be automatically enabled. For older apps, enable it in your Kernel class.

How does the redirection process work?

Redirecting an envelope from one bus to another is quite simple with a middleware. It has to catch the envelope from the current bus and dispatch it into the target bus. Currently, the middleware does not pass the envelope to the next middleware. That means that the envelope will not be processed on the source bus. (this behavior may change or become configurable)

How does the bundle know what the target bus is?

The target bus is determined by redirect strategies. That are services that implement the RedirectStrategyInterface. They receive the envelope and return the name of the bus it should be passed to.

Currently, two strategies are implemented: the MessageClassStrategy and the DecisionMakerStrategy. The first one uses a Message-Class-to-Bus-Name map from the bundle configuration (described later) to find the bus name by the class of the message. The second one is more flexible. It allows the creation of decision maker services, that implement the DecisionMakerInterface. This strategy passes the responsibility for the logic to the person, who uses this bundle.

⚠ Multiple strategies can be used in a configured order. The middleware will use the first non-null bus name that is returned from a strategy.

⚠ The DecisionMakerStrategy calls the decision makers in no particular order. So, the decision makers should always return null if they should be not responsible.

How to configure this bundle?

The following configuration uses the MessageClassStrategy and the DecisionMakerStrategy.

Any unknown strategy will result in a configuration error.

The MessageClassStrategy requires additional configuration to work:

The message classes have to be fully qualified class names. The bus names have to match the ones from the messenger configuration.

The DecisionMakerStrategy requires no additional configuration but at least one registered decision maker.

How to enable the middleware?

The middleware will only be used if a bus is configured to do so:

The Symfony messenger allows no explicit middleware order. In general the MessageRedirectMiddleware can be used in any position and will work just fine (if no other middleware interferes). But it makes more sense to place it on one of the first positions to avoid unnecessary processing. If the configured bus should only be used for redirection, the MessageRedirectMiddleware should be the only middleware. If other middleware should be called they have to be put first by their service name. (this example uses the default middlewares normally configured by Symfony but without the HandleMessageMiddleware)

Contributing

I am really happy that the software developer community loves Open Source, like I do! ♥

That's why I appreciate every issue that is opened (preferably constructive) and every pull request that provides other or even better code to this package.

You are all breathtaking!


All versions of message-bus-redirect-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
symfony/config Version ^5.4|^6.1
symfony/dependency-injection Version ^5.4|^6.1
symfony/http-kernel Version ^5.4|^6.1
symfony/messenger Version ^5.4|^6.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 it-bens/message-bus-redirect-bundle contains the following files

Loading the files please wait ....