PHPackages                             ikilobyte/pulsar-client-php - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. ikilobyte/pulsar-client-php

ActiveLibrary[HTTP &amp; Networking](/categories/http)

ikilobyte/pulsar-client-php
===========================

PHP Native Client library for Apache Pulsar

v1.4.9(3w ago)60119.7k↓46.8%16[7 issues](https://github.com/ikilobyte/pulsar-client-php/issues)1MITPHPPHP &gt;=7.1CI passing

Since Jul 13Pushed 3w ago3 watchersCompare

[ Source](https://github.com/ikilobyte/pulsar-client-php)[ Packagist](https://packagist.org/packages/ikilobyte/pulsar-client-php)[ RSS](/packages/ikilobyte-pulsar-client-php/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (6)Versions (36)Used By (1)

PHP Native Pulsar Client
========================

[](#php-native-pulsar-client)

Contents
========

[](#contents)

- [Contents](#Contents)
    - [About](#About)
    - [Requirements](#Requirements)
    - [Installation](#Installation)
    - [Producer](#Producer)
    - [Consumer](#Consumer)
    - [TLS](#TLS)
    - [Schema](#Schema)
    - [Reader](#Reader)
    - [Options](#Options)
    - [MCP Server for AI Agents](#MCP-Server-for-AI-Agents)
    - [License](#License)

About
-----

[](#about)

English | [中文](README-CN.md)

This is a [Apache Pulsar](https://pulsar.apache.org) client library implemented in php Reference [PulsarApi.proto](src/PulsarApi.proto) And support Swoole coroutine

Features

- Support URL (`pulsar://` 、 `pulsar+ssl://` 、 `http://` 、 `https://`)
- Multi topic consumers
- TLS connection
- Automatic reconnection (Only Consumer)
- Message batching
- Message Properties
- Compression with `zstd`, `zlib`
- Authentication with `jwt`, `basic`

Requirements
------------

[](#requirements)

- PHP &gt;=7.1
- ZLib Extension（If you want to use `zlib` compression）
- Zstd Extension（If you want to use `zstd` compression）
- Swoole Extension(If you want to use in swoole)
    - Use in the swoole only requires that the `SWOOLE_HOOK_SOCKETS、SWOOLE_HOOK_STREAM_FUNCTION` or `SWOOLE_HOOK_ALL`

Tips
----

[](#tips)

> If the following error occurs, please install extension `gmp` or `bcmath`

```
Negative integers are only supported with GMP or BC (64bit) intextensions.
```

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

[](#installation)

```
composer require ikilobyte/pulsar-client-php
```

Producer
--------

[](#producer)

```
