Download the PHP package hnto/bick without Composer

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

Bick

Bick is a RabbitMQ wrapper built with the official php-amqlib library. Besides a wrapper for simple setup, publish and consume, Bick can also be used for batch publshing messages, keeping track of them etc.

#

Install

#

Possibilities

#

Setup

Example

Publish message

The Bick object can be used to retrieve a BickPublisherInterface and publish a message. The publish method inside the publisher requires a BickMessageInterface object and throws an exception on an invalid BickMessage

Due note: when using the default BickPublisher class and you don't want to use persistence, set it to false using the publisher method BickPublisher::persistMessages(false).

Example

Publish messages (batch)

The Bick object also offers the option to publish messages in a batch. The logic is the same as when publishing one message. The difference is that you send an array of BickMessage objects.

Example

Consuming messages

For consuming messages you must create your own consumer class. This class must implement BickConsumerInterface and BickConnectionShutdownInterface. For a more easy setup, you can also extend the abstract BickConsumer. The only method you are required to implement is the process method. This method is given a BickMessageInterface. Within this method you are required to return a status. These statuses can be found within the BickMessageInterface as constants. A consumer class can be retrieved by executing the Bick object method consumer. To start consuming messages execute the consume method inside the consumer class.

Due note: when using the BickConsumer abstract, set the protected member var $persist to false if you don't want to use persistence

Example

When using the BickConsumer you can "translate" a raw AMQP message to a message of your own that implements BickMessageInterface. This way you have full control over what goes inside the message body and further info. Upon requesting the default BickConsumer the standard translator is set in order to create a default BickMessage object. Replacing the default translator can be done with the setTranslator method.

Message persistence

Persisting messages in order to keep track of them

In Bick you can persist messages into a data storage by providing a data storage adapter object. This adapter can be whatever you'd like (MySQL, Redis, File). The BickPublisher and BickConsumer objects already have the implemention available for persisting messages into a data storage using the method persist of your adapter. The only thing they require is an Adapter variable that you set in the setAdapter method of these classes. This adapter must implement the PersistenceAdapterInterface. What and how you save this data, is up to you.

Example

Persisting messages after a NACK in order to analyse them

In Bick you can persist a message that was a "NACK" and provide optional information regarding the fault. In order to implement this functionality your consumer must implement the interface MessageFaultAnalyseInterface. This interface requires that you define a method called analyse which requires a BickMessage object. Furthermore you must assign a BickMessageFault object to the member var protected $fault. This fault is sent to the data storage along with the message; this class implements JsonSerializable. The BickConsumer has this implementation by default. So if you extend it you're messages are stored automatically into a data storage when returning a NACK status.

Example

Bick adapter

Bick has its own adapter for saving/tracking the messages. This is a PDO adapter connecting to a relational database of your choice (MySQL/MariaDB/Postgre).

SQL tables

Example

You can implement the Bick adapter in this way

Facts

To do


All versions of bick with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1.3
php-amqplib/php-amqplib Version ^2.8
ramsey/uuid Version ^3.8
ext-json Version *
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 hnto/bick contains the following files

Loading the files please wait ....