PHPackages                             elixis-group/google-cloud-queue-process - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. elixis-group/google-cloud-queue-process

ActiveLibrary[Queues &amp; Workers](/categories/queues)

elixis-group/google-cloud-queue-process
=======================================

Package php to extends google/cloud-pubsub, this component is used to publish a new message in pub / sub and other tools than the basic component, this one allow to go further with Pub / Sub tool.

2.0.0(1mo ago)0157MITPHPPHP &gt;=8.2

Since Jan 20Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/ELIXIS-GROUP/google-cloud-queue-process)[ Packagist](https://packagist.org/packages/elixis-group/google-cloud-queue-process)[ RSS](/packages/elixis-group-google-cloud-queue-process/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependencies (14)Versions (11)Used By (0)

Google queue process for php (v1.3.0)
=====================================

[](#google-queue-process-for-php-v130)

gcp-queue-process is an app to interact with the lib [google-cloud-php-pubsub](https://github.com/googleapis/google-cloud-php-pubsub), and now the lib implement the service [google-cloud-php-tasks](https://github.com/googleapis/google-cloud-php-tasks) to use GCP cloudTasks.

### PubSub

[](#pubsub)

This lib make available many method to publish push or pull message. If you use method push or pull do you have the possibility to dynamically create new "topic" and new "subscription" ( create subscription are only available for pull method). See documentation to learn more.

### CloudTasks

[](#cloudtasks)

gcp-queue-process also provides a method to post a message to CloudTasks. If you are using CloudTask, it is possible to create a new queue from this tool during the message publishing process.

Installation
------------

[](#installation)

To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/).

Install this component with composer

```
$ composer require elixis-group/google-cloud-queue-process

```

Sample to publish message
-------------------------

[](#sample-to-publish-message)

### Publish PubSub message

[](#publish-pubsub-message)

```
require_once __DIR__ . '/vendor/autoload.php';

use GoogleCloudQueueProcess\Handler\PubSub\MessagePublisherHandler;
use GoogleCloudQueueProcess\Service\PubSub\PubSubService;

$messagePublisher = new MessagePublisherHandler();
$pubSubService 	  = new PubSubService();

$content      = json_encode(["blue", "green", "yellow", "red"]);
$type         = "pull"; //use value "push" to use push message
$topic        = "topic-name";
$subscription = "subsciption-name";

$messagePublisher->publishMessage( $content, $type, $topic, $subscription, $pubSubService);

```

### Publish CloudTasks message

[](#publish-cloudtasks-message)

```
require_once __DIR__ . '/vendor/autoload.php';

use GoogleCloudQueueProcess\Handler\CloudTasks\MessagePublisherHandler;
use GoogleCloudQueueProcess\Service\CloudTasks\CloudTasksService;

$messagePublisher  = new MessagePublisherHandler();
$cloudTasksService = new CloudTasksService();

$message        = json_encode(["blue", "green", "yellow", "red"]);
$queuename      = "queuename";
$urlTaskHandler = "/task-handler-url";

$messagePublisher->publishMessage( $message, $queuename, $urlTaskHandler, $cloudTasksService);

```

Sample to consume message
-------------------------

[](#sample-to-consume-message)

For process your data, create a new class who extends the class MessageHandler Base for Pub Sub or Cloud Tasks and contain a method "processedData".
This method conten your code for processed your message.

```
namespace ACME;

use GoogleCloudQueueProcess\Handler\PubSub\MessageHandlerBase;

class ACMEMessageHandler extends MessageHandlerBase{

	public function processedData( Array $data )
	{
		//Add your script to process the message.
	}

}

```

### Consume PubSub message

[](#consume-pubsub-message)

```
require_once __DIR__ . '/vendor/autoload.php';

use GoogleCloudQueueProcess\Handler\PubSub\MessageConsumerHandler;
use ACME\ACMEMessageHandler;

$messageConsumer = new MessageConsumerHandler();
$messageHandler  = new ACMEMessageHandler();

//use "tokenEmail" and "tokenAudience" define in subsciption config.

$request              = file_get_contents('php://input');
$tokenEmail           = "acme@serviceaccount.iam.gserviceaccount.com";
$tokenAudience        = "http://acme-app.com/url";
$googleCredentialPath = "acme@serviceaccount.iam.gserviceaccount.com.json";

$messageRequest  = $messageConsumer->getRequestContent($request, $tokenEmail, $tokenAudience, $googleCredentialPath);

$messageConsumer->pushConsumer($messageRequest, $messageHandler);

```

### Consume CloudTasks message

[](#consume-cloudtasks-message)

```
require_once __DIR__ . '/vendor/autoload.php';

use GoogleCloudQueueProcess\Handler\CloudTasks\MessageConsumerHandler;
use ACME\ACMEMessageHandler;

$messageConsumer = new MessageConsumerHandler();
$messageHandler  = new ACMEMessageHandler();

$request = file_get_contents('php://input');

$messageRequest  = $messageConsumer->getRequestContent($request);

$messageConsumer->pushConsumer($messageRequest, $messageHandler);

```

Contribution
------------

[](#contribution)

If you contribute at this project before push your modif, don't forget execute php-cs-fixer, phpunit and php-stan, to fix errors and code structure.

*Before execute tests, go to GCP console and create topic "test-push-topic" and the subscription "test-push-subscription" with type "push". This is necessary to execute correctly the following unit tests.
Finish test config add your GOOGLE-PROJECT-ID in phpunit.xml.*

```
$ vendor/bin/phpunit tests

$ vendor/bin/php-cs-fixer fix --config .php-cs-fixer.php

$ vendor/bin/phpstan analyse src && vendor/bin/phpstan analyse tests

```

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance89

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~270 days

Recently: every ~390 days

Total

8

Last Release

54d ago

Major Versions

1.5.0 → 2.0.02026-03-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/2381ef8f31e063667ae816cab4ed768e4565bb81018e494d06a1eb0db371bf10?d=identicon)[elixis-digital](/maintainers/elixis-digital)

---

Top Contributors

[![biqette](https://avatars.githubusercontent.com/u/6476885?v=4)](https://github.com/biqette "biqette (43 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/elixis-group-google-cloud-queue-process/health.svg)

```
[![Health](https://phpackages.com/badges/elixis-group-google-cloud-queue-process/health.svg)](https://phpackages.com/packages/elixis-group-google-cloud-queue-process)
```

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[jolicode/castor

A lightweight and modern task runner. Automate everything. In PHP.

53541.0k3](/packages/jolicode-castor)[stackkit/laravel-google-cloud-tasks-queue

Google Cloud Tasks queue driver for Laravel

84570.1k](/packages/stackkit-laravel-google-cloud-tasks-queue)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[novosga/novosga

Customer queue management system

26457.9k](/packages/novosga-novosga)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
