Download the PHP package ikilobyte/pulsar-client-php without Composer
On this page you can find all versions of the php package ikilobyte/pulsar-client-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package pulsar-client-php
PHP Native Pulsar Client
Contents
- Contents
- About
- Requirements
- Installation
- Producer
- Consumer
- TLS
- Schema
- Reader
- Options
- License
About
English | 中文
This is a Apache Pulsar client library implemented in php Reference 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
- PHP >=7.0 (Supported PHP8)
- 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
orSWOOLE_HOOK_ALL
- Use in the swoole only requires that the
Tips
If the following error occurs, please install extension
gmp
orbcmath
Installation
Producer
Keepalive Connection (Recommended)
- require
Swoole
extension - If it is a resident memory application, it is recommended to open it.
- Will keep connected, no need to repeatedly establish a connection
- Calling the
close
method closes the connection - Please see example
Message deduplication
- Message de-duplication is a feature provided by pulsar and is based on the producer name and sequence number ID
- The name of the same producer needs to be fixed and unique, generally distinguished by business latitude, and the sequence number ID of each message is unique and self-incrementing.
- Reference Pulsar Docs
Consumer
Receive Batch Message
- Only when the producer sends the message in bulk can the batch message be received.
Subscribe to multiple topics
Dead letter topic
Reconnect(Only Support Consumer)
Not loop Receive And Smooth exit
TLS
-
Refer to the official documentation for certificate configuration
- Example
Schema
- Currently only supports
INT8
、INT16
、INT32
、INT64
、DOUBLE
、STRING
、JSON
,The following code usesJSON Schema
as an example - https://pulsar.apache.org/docs/2.11.x/schema-overview/
-
model.php
-
Producer Statement Schema
- Consumer Statement Schema
Reader
Options
- ProducerOptions
- setTopic()
- setAuthentication()
- setConnectTimeout()
- setProducerName()
- setCompression()
- setSchema()
- setKeepalive()
- ConsumerOptions
- setTopic()
- setTopics()
- setAuthentication()
- setConnectTimeout()
- setConsumerName()
- setSubscription()
- setSubscriptionType()
- setNackRedeliveryDelay()
- setReceiveQueueSize()
- setDeadLetterPolicy()
- setSubscriptionInitialPosition()
- setReconnectPolicy()
- setSchema()
- ReaderOptions
- setTopic()
- setAuthentication()
- setConnectTimeout()
- setReaderName()
- setStartMessageID()
- setReceiveQueueSize()
- MessageOptions
- DELAY_SECONDS
- SEQUENCE_ID
- PROPERTIES
- TLSOption (v1.3.0)
- __construct(string $certFilePath, string $keyFilePath)
- setTrustCertsFilePath()
- setValidateHostname()
- setAllowInsecureConnection()
MessageNotFound ErrCode (v1.2.1)
MessageNotFound::Ignore
MessageNotFound::CommandParseFail
License
MIT LICENSE
All versions of pulsar-client-php with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.0
google/crc32 Version ^0.1.0
protobuf-php/protobuf Version ^0.1.3
ext-curl Version *
google/crc32 Version ^0.1.0
protobuf-php/protobuf Version ^0.1.3
ext-curl Version *
The package ikilobyte/pulsar-client-php contains the following files
Loading the files please wait ....