SimplePMS is a PHP message service with database backend using SQLite, PostgreSQL or MySQL

dev-master 2016-05-08 12:51 UTC

This package is auto-updated.

Last update: 2023-03-10 19:17:13 UTC


Build Status Coverage Status

SimplePMS is a very simple messaging service component with a database backend.

It allows applications to communicate without a heavy traditional client-server architecture. It is a way to manage asynchronous, potentially long-running PHP tasks such as API requests, database export/import operations, email sending, payment notification handlers, feed generation etc.

This project is based on php-queue-manager, except I wanted my messages to be only messages. Therefore, messages are not tasks in SimplePMS and are not expected to carry business code.

SimplePMS can be integrated to any PHP based application with minimum effort, because it does not depend on any framework. PDO extension is the only requirement.

If you need a more feature-full messaging service - e.g. multiple workers consuming the same queue - consider using a robust messaging service/queue manager such as JMS, ActiveMQ, RabbitMQ, IronMQ, etc. ; even though it requires a more complex setup.


  • PHP >5.5
  • PDO
  • Database backend (sqlite, PostgreSQL, MySQL)


  • Asynchronous messaging service through database.
  • Send any type of data.
  • Multiple queues.
  • A timeout system to handle stuck messages.
  • All actions are log in the DB.

Install with Composer

  • Install dependency
    "require": {
        "arthurhoaro/simple-php-messaging-service": "dev-master"
  • Create your database structure using one of the schema available in extra/.

Usage example

// Your software send a message to a worker
$message = new Anything('param');
$pms = new SimplePMS();
$pms->send($message, 'my_queue');

// The worker reads the queue
$message = $pms->reveive('my_queue');
try {
} catch (\Exception $e) {
    $pms->log('Can not do anything. '. $e->getMessage());