PHPackages                             linxi/pulsar-client - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. linxi/pulsar-client

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

linxi/pulsar-client
===================

15PHP

Since Dec 17Pushed 1y ago1 watchersCompare

[ Source](https://github.com/guofuzhang/pulsar-client)[ Packagist](https://packagist.org/packages/linxi/pulsar-client)[ RSS](/packages/linxi-pulsar-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

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

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

Contents
========

[](#contents)

- [Contents](#Contents)
    - [About](#About)
    - [Requirements](#Requirements)
    - [Installation](#Installation)
    - [registering](#registering)
    - \[Publish Vendor Files\](#Publish Vendor Files)
    - [config/pulsar.php](#config/pulsar.php)
    - [Producer](#Producer)
    - [Consumer](#Consumer)
    - [Options](#Options)
    - [Options](#Options)
    - [License](#License)

About
-----

[](#about)

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
- Authentication with `jwt`, `basic`

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

[](#requirements)

- PHP &gt;=7.0 (Supported PHP8)
- 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`

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

[](#installation)

```
composer require linxi/pulsar-client
```

registering
-----------

[](#registering)

registering service providers and facades in the config/app.php

```
 'providers' => [
        PulsarProducerProvider::class,
        PulsarConsumerProvider::class,],
 'aliases' => [
        'PulsarProducer' => PulsarProducer::class,
        'PulsarConsumer' => PulsarConsumer::class,
]
```

Publish Vendor Files
--------------------

[](#publish-vendor-files)

This command will generate a pulsar.php configuration file in the config directory. This file contains the configuration settings for the Pulsar client.

```
php artisan vendor:publish --provider="Linxi\PulsarClient\PulsarProducerProvider"
```

### config/pulsar.php

[](#configpulsarphp)

the default option is default

```
