Download the PHP package vrok/messenger-reply without Composer

On this page you can find all versions of the php package vrok/messenger-reply. 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 messenger-reply

vrok/messenger-reply

This is a library to allow symfony/messenger to reply to messages with a result.
This is meant to be used in a setup with AMQP transport and two symfony instances talking to each other over the same broker: e.g. a web frontend and a microservice, where the frontend sends tasks to the service and requests a reply, for example a generated PDF file.

CI Status Coverage Status

Setup

Installation on both sides (You need the ReplyToStamp on the request side and the middleware + stamp on the receiving side): composer require vrok/messenger-reply

You need request and reply message classes that are equal on both sides, e.g. use a shared composer package:

Requesting side

Add a transport for the shared AMQP broker, routing to the input of the receiver (having the same exchange and queue name as the receivers input queue).

Add a transport for the shared AMQP broker, for receiving the replies (matching the exchange and queue name of the receivers output queue): We need separate transports as messenger:consume [transportname] consumes all messages in all queues for that transport.

Route your requests to the shared transport/queue:

Replying side

Configure the middleware service:

Enable the middleware on your message bus:
(We have to disable the default middleware and explicitly define the order as there is no priority option, just adding our service to the middleware-option would add it before send_middleware. See https://github.com/symfony/symfony/issues/28568)

Configure an input transport where you send messages from the external applications, which are consumed by your worker(s). And an output transport where the replies are sent, optimally with one queue for each application sending requests, so the only consume the replies meant for them. We need separate transports as messenger:consume [transportname] consumes all messages in all queues for that transport.

All replies should be routed to the output transport:

Usage

Dispatch the request message with the attached ReplyStamp so the receiver knows where to send the replies:

Implement a MessageHandler that handles the requests and returns the reply Message object:

Consume requests (only on the input queue!) on the receiver side:

./bin/console messenger:consume input

Consume replies (only on the output queue!) on the requesting side:

./bin/console messenger:consume pdf-results

If you need to know on the requesting side which task to resume etc. with the received reply, you can implement the Vrok\MessengerReply\TaskIdentifierMessageInterface (and use the Vrok\MessengerReply\TaskIdentifierMessageTrait) on your request and reply message classes to automatically transfer the task and/or identifier properties given on the request to the reply. We cannot use stamps for this as stamps are not accessible by MessageHandlers.


All versions of messenger-reply with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
symfony/amqp-messenger Version ^7.2.0|^8.0.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 vrok/messenger-reply contains the following files

Loading the files please wait ...