Download the PHP package facile-it/mongodb-messenger-transport without Composer

On this page you can find all versions of the php package facile-it/mongodb-messenger-transport. 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 mongodb-messenger-transport

facile-it/mongodb-messenger-transport

A Symfony Messenger transport on MongoDB, on top of facile-it/mongodb-bundle

CI Static analysis codecov

Installation

This package register itself as a bundle inside Symfony; you have to have both it and the FacileMongoDbBundle enabled, if you hadn't it before. To do it, you either:

Configuration

  1. If you haven't already, configure the MongoDB connection following instructions for facile-it/mongodb-bundle
  2. Using the connection name from that configuration (i.e. default in the Flex recipe), configure a new transport for the Messenger like this:

Note: when using it for the first time, or when calling the messenger:setup-transports console command, this transport creates the collection with an index for optimal performances, since it's tailored to the properties that are used to retrieve the messages.

Suggestions

It's suggested to use this transport for failed messages, like the Doctrine one; if you want to do that, you can do it like this:

If you configure this transport multiple times, remember to use the queue_name and/or the collection_name options (see below) to differentiate the messages.

Full configuration reference

This transport, like other default ones, has a number of options available, which can be passed as a query string in the DSN, or as an array below, like in the following example (all values are the provided defaults):

The redeliver_timeout option

The redeliver_timeout works in the same way as the DoctrineTransport: when a message is delivered but not acked nor rejected (maybe due to a fatal crash or a network failure), it works as a timeout, and makes the message redeliverable after it expires.

The document_enhancers option

The document_enhancers option is an extension point of this transport; it accepts an array of strings, each of them a fully qualified class name or a service name with the @ prefix.

It allows the end user to add fields to the document that will be persisted for each message. Each enhancer has to implement the Facile\MongoDbMessenger\Extension\DocumentEnhancer interface, which requires the implementation of a enhance(BSONDocument $document, Envelope $envelope): void method. The BSONDocument will be persisted afterwards, and it can be enriched with additional properties, which can be useful for searching and indexing for specific information with i.e. MongoDbTransport::find.

You can take a look at the provided \Facile\MongoDbMessenger\Extension\DocumentEnhancer\LastErrorMessageEnhancer as an example, or use it like this:


All versions of mongodb-messenger-transport with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
ext-mongodb Version ^1.6
facile-it/mongodb-bundle Version ^1.6
mongodb/mongodb Version ^1.5
symfony/deprecation-contracts Version ^2.1 || ^3.0
symfony/framework-bundle Version ^4.4 || ^5.0 || ^6.0 || ^7.0
symfony/messenger Version ^4.4 || ^5.0 || ^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 facile-it/mongodb-messenger-transport contains the following files

Loading the files please wait ....