Download the PHP package swarrot/swarrot-bundle without Composer

On this page you can find all versions of the php package swarrot/swarrot-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 swarrot-bundle

SwarrotBundle

Latest Stable Version Latest Unstable Version

A bundle to use Swarrot inside your Symfony application.

Installation

The recommended way to install this bundle is through Composer. Just run:

Register the bundle in the kernel of your application:

Configuration reference

Publishing a message

First step is to retrieve the Swarrot publisher service from your controller.

After that, you need to prepare your message with the Message class.

Then you can publish a new message into a predefined configuration (connection, exchange, routing_key, etc.) from your message_types.

When publishing a message, you can override the message_types configuration by passing a third argument:

Consuming a message

Swarrot will automatically create one command per consumer defined in your configuration. These command need the queue name to consume as first argument. You can also use a named connection as second argument if you don't want to use the default one.

Your consumer () must implements

Your processor will also be decorated automatically by all processors listed in the middleware_stack section. The order matters.

All these processors are configurable. You can add an extras key on each configurator definition in your config.yml. Take a look at the configuration reference to see available extras for existing Configurators.

You can also use options of the command line:

Default values will be overriden by your config.yml and usage of options will override default config values.

Run your command with -h to have the full list of options.

Note that you can define one or more aliases for this command using the command_alias configuration:

Thus allowing you to consume messages using a more appropriate wording:

Implementing your own Provider

If you want to implement your own provider (like Redis), you first have to implement the Swarrot\SwarrotBundle\Broker\FactoryInterface. Then, you can register it along with the others services and tag it with swarrot.provider_factory.

Now you can tell Swarrot to use it in the config.yml file.

or with the alias

Using a custom processor

If you want to use a custom processor, you need two things. The Processor itself and a ProcessorConfigurator. For the Processor, you can refer to the swarrot/swarrot documentation. For the ConfigurationProcessor, you need to implement the ProcessorConfiguratorInterface and to register it as an abstract service, like this:

Once done, just add it to the middleware stack of your consumer:

As usual, take care of the order of your middleware_stack.

Running your tests without publishing

If you use Swarrot, you may not want to actually publish messages when in test environment for example. You can use the BlackholePublisher to achieve this.

Simply override the swarrot.publisher.class parameter in the DIC with the Swarrot\SwarrotBundle\Broker\BlackholePublisher class, by updating config_test.yml for instance:

Broker configuration

This bundle goal is to deal with message consuming, not to deal with your broker configuration. We don't want to mix the infrastructure logic with the consuming one.

If you're looking for a tool to configure your broker, take a look at odolbeau/rabbit-mq-admin-toolkit.

License

This bundle is released under the MIT License. See the bundled LICENSE file for details.


All versions of swarrot-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
psr/log Version ^1.0|^2.0|^3.0
swarrot/swarrot Version ^4.0
symfony/config Version ^5.4|^6.0|^7.0
symfony/console Version ^5.4|^6.0|^7.0
symfony/dependency-injection Version ^5.4|^6.0|^7.0
symfony/http-kernel Version ^5.4|^6.0|^7.0
symfony/yaml Version ^5.4|^6.0|^7.0
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 swarrot/swarrot-bundle contains the following files

Loading the files please wait ....