PHPackages                             pnixx/clickhouse-queue - 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. pnixx/clickhouse-queue

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

pnixx/clickhouse-queue
======================

Clickhouse insert buffer queue using RabbitMQ

1.0.7(8mo ago)013PHPPHP &gt;=8.1CI passing

Since Jan 22Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/PNixx/clickhouse-queue)[ Packagist](https://packagist.org/packages/pnixx/clickhouse-queue)[ RSS](/packages/pnixx-clickhouse-queue/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (7)Versions (9)Used By (0)

Clickhouse Queue
================

[](#clickhouse-queue)

Clickhouse insert buffer queue using RabbitMQ STOMP protocol.

Required PHP Version
--------------------

[](#required-php-version)

- PHP 8.1+

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

[](#installation)

This package can be installed as a [Composer](https://getcomposer.org/) dependency.

```
composer require pnixx/clickhouse-queue
```

Example usage
-------------

[](#example-usage)

```
$worker = new ClickhouseWorker([
	'clickhouse' => [
		'database' => 'example',
		'host'     => 'localhost',
		'port'     => 8123,
	],
	'stomp'      => [
		'host'  => 'localhost',
		'port'  => 61613,
		'queue' => 'clickhouse',
	],
], __DIR__ . '/../tmp');

Worker::runAll();
```

This worker will listen the queue `clickhouse` and will inserting bulk data to ClickHouse database. For run worker:

```
php examples/run.php start
```

Docker
------

[](#docker)

Build and run from source:

```
docker build --rm -t clickhouse-queue .
docker run --name clickhouse-queue clickhouse-queue
```

Run container with shared tmp directory:

```
docker run -it -v /path/to/tmp:/var/www/clickhouse-queue/tmp --name clickhouse-queue pnixx/clickhouse-queue
```

Environment variables:

- `CLICKHOUSE_HOST` - ClickHouse host for inserts, default `localhost`
- `CLICKHOUSE_PORT` - ClickHouse port for inserts, default `8123`
- `CLICKHOUSE_DB` - ClickHouse database for inserts, default `default`
- `CLICKHOUSE_USER` - ClickHouse user, optional
- `CLICKHOUSE_PASSWORD` - ClickHouse password, optional
- `CLICKHOUSE_SSL` - ClickHouse need use HTTPS connection instead HTTP, default `false`
- `RABBIT_HOST` - RabbitMQ host for subscribe, default `localhost`
- `RABBIT_STOMP_PORT` - RabbitMQ STOMP port, default `61613`
- `RABBIT_USER` - RabbitMQ STOMP login user, default `guest`
- `RABBIT_PASSWORD` - RabbitMQ STOMP login password, default `guest`
- `RABBIT_QUEUE` - RabbitMQ queue for buffer data, default `clickhouse`
- `RABBIT_VHOST` - RabbitMQ vhost, default `/`
- `MAX_DELAY` - time flush data to ClickHouse, default `5`
- `MAX_FILE_SIZE` - max buffer size before flush to ClickHouse, default `5242880`
- `LOG_LEVEL` - output log level, default `warning`

Message structure
-----------------

[](#message-structure)

Header `table`: to insert data into the specified table

Body: JSON as string row data

```
{"column1": "data1", "column2": "data2"}
```

Development
-----------

[](#development)

Testing GitHub actions:

```
act
```

Donations
---------

[](#donations)

Donations to this project are going directly to [PNixx](https://github.com/PNixx), the original author of this project:

- BTC address: `1H3rhpf7WEF5JmMZ3PVFMQc7Hm29THgUfN`
- ETH address: `0x6F094365A70fe7836A633d2eE80A1FA9758234d5`
- XMR address: `42gP71qLB5M43RuDnrQ3vSJFFxis9Kw9VMURhpx9NLQRRwNvaZRjm2TFojAMC8Fk1BQhZNKyWhoyJSn5Ak9kppgZPjE17Zh`
- TON address: `UQB5RntjBNMA6qXjuqTrl2TcqceNu3vMOj1AyyW3eeGGI-Qd`

Contributing
------------

[](#contributing)

Bug reports and pull requests are welcome on GitHub at . This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

License
-------

[](#license)

The MIT License (MIT). Please see [`LICENSE`](./LICENSE) for more information.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance59

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

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

Total

8

Last Release

258d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/02c8f1735bd7e79c5c23264f6339c560683685f8ec5b6090eb950e50bb7f486d?d=identicon)[PNixx](/maintainers/PNixx)

---

Top Contributors

[![PNixx](https://avatars.githubusercontent.com/u/1117351?v=4)](https://github.com/PNixx "PNixx (12 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pnixx-clickhouse-queue/health.svg)

```
[![Health](https://phpackages.com/badges/pnixx-clickhouse-queue/health.svg)](https://phpackages.com/packages/pnixx-clickhouse-queue)
```

###  Alternatives

[symfony/messenger

Helps applications send and receive messages to/from other applications or via message queues

1.1k120.7M958](/packages/symfony-messenger)[symfony/amazon-sqs-messenger

Symfony Amazon SQS extension Messenger Bridge

4612.5M15](/packages/symfony-amazon-sqs-messenger)[pmg/queue

A task queue framework for PHP

13460.6k8](/packages/pmg-queue)[amphp/cluster

Building multi-core network applications with PHP.

6224.8k1](/packages/amphp-cluster)[webfactory/icu-translation-bundle

Enables ICU message formatting for translations in Symfony applications.

2761.8k](/packages/webfactory-icu-translation-bundle)[workerman/rabbitmq

Asynchronous rabbitmq client for PHP based on workerman.

4313.4k6](/packages/workerman-rabbitmq)

PHPackages © 2026

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