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.1(4mo ago)0170MITPHPPHP &gt;=8.2

Since Jan 20Pushed 4mo 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 1w ago

READMEChangelogDependencies (21)Versions (12)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

46

—

FairBetter than 92% of packages

Maintenance76

Regular maintenance activity

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity73

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 ~238 days

Recently: every ~170 days

Total

9

Last Release

131d 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.4k1.5M3](/packages/shopware-platform)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.8M672](/packages/shopware-core)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.2k19.7k](/packages/prestashop-prestashop)[bitrix24/b24phpsdk

An official PHP library for the Bitrix24 REST API

10250.3k6](/packages/bitrix24-b24phpsdk)[contao/manager-bundle

Provides the Contao Managed Edition

181.3M83](/packages/contao-manager-bundle)[chameleon-system/chameleon-base

The Chameleon System core.

1029.4k6](/packages/chameleon-system-chameleon-base)

PHPackages © 2026

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