Download the PHP package serrvius/amqp-rpc-extender without Composer

On this page you can find all versions of the php package serrvius/amqp-rpc-extender. 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 amqp-rpc-extender

About

The extension of symfony/amqp-messenger that allow to implement CQRS/gRPC (call and wait response) in RabbitMQ Broker, idea has to used it in microservices architecture

What it does

This bundle use ampq:// default transporter of symfony. The CompilerPass of bundle connect those layers of default amqp-messenger to control the messages that have specific stamp. The queues type is recommended to be used direct

Requirements

Installation

Usage

We need to replace de default symfony messenger serializer messenger.transport.symfony_serializer with the one that provide the extension messenger.transport.rpc.symfony_serializer, that is needed to encode and decode the messages in the right way.


Gateway side

All call initiator messages (from the gateway) classes need to implement the interface:

the abstract method amqpRpcStamp should return the instance of

For command messages (classic async work - don't need the callback) the method: amqpRpcStamp should return: Serrvius\AmqpRpcExtender\Stamp\AmqpRpcCommandStamp

For query messages (need response from microservice) the method: amqpRpcStamp should return: Serrvius\AmqpRpcExtender\Stamp\ Serrvius\AmqpRpcExtender\Stamp\AmqpRpcQueryStamp

Examples of gateway messages:

Query message:

Command message:

Those stamps AmqpRpcQueryStamp and AmqpRpcCommandStamp implement the AmqpRpcStampInterface


Microservice side

On microservice side we have two ways of handle the message, for correct decoding the message and map it into object bundle offer annotations or classic interface implementing:

The command need to implement the interface

the methods executorName should return the name of executor of gateway command and in method setCommandData the bundle will put the input message as array

Examples of microservice command messages:

the second way to define the message is to use the annotation

the attribute of it is name represent also the executorName from gateway

in that way the data will be mapped into object to properties the handler will be implemented as usual

The query messages like command was two ways of definition, by the interface

or annotation

Examples of microservice query messages:

the method executorName should return the executorName from gateway query call and in method setQueryData will receive the input data as array.

On command the handler will be called as usual messenger doing it

The annotation version of message is:

the name of annotation is also the executorName of gateway message and the data will be mapped into properties

The handler of query should return the data that to return it on the gateway request which will waiting for it

For accessing the response data from query request after message was dispatched in envelop that will be returned by dispatch, access the stamp.

The stamp has the method getResults and there will be present the response data also like additional stamp with response there will be the HandledStamp

Additional

The query request stamp

accept those attributes:

Remarks

The inspiring and documentation used for did that work was taken from:

leberknecht/amqp-rpc-transporter-bundle

Remote procedure call (RPC)


All versions of amqp-rpc-extender with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-amqp Version *
symfony/amqp-messenger Version ^6.4
symfony/property-info Version ^6.4
symfony/uid Version ^6.4
symfony/serializer-pack Version ^1.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 serrvius/amqp-rpc-extender contains the following files

Loading the files please wait ....