Download the PHP package volcengine/ve-rocketmq-php-sdk without Composer

On this page you can find all versions of the php package volcengine/ve-rocketmq-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ve-rocketmq-php-sdk

RocketMQ PHP SDK

火山引擎消息队列 RocketMQ版PHP SDK 是基于 HTTP-Proxy 的RocketMQ客户端。 该SDK可通过RocketMQ实例的Http Proxy 接入点连接实例,实现消息的生产与消费。

安装

快速开始

创建客户端。

初始化一个RocketMQ客户端需要准备好火山引擎RocketMQ实例的HTTP Proxy接入点、accessKey和secretKey。

生产

创建生产者

调用client实例的 createProducer() 方法即可创建一个生产者实例。

创建消息

一条消息拥有很多属性topic、body、tag、key等,可以使用 Message 实例化一个消息的信息对象并可在这个对象上设置这些属性。

生产消息

调用producer实例的 publishMessage() 方法就能发布一条消息。在发布消息前还需要调用 open() 方法在服务端开启一个生产者实例, 在不需要发送消息时可以调用 close() 方法销毁。

消费

创建消费者

调用client实例的 createConsumer() 方法即可创建一个消费者实例, 创建消费者时必须指定消费者的GroupID。

消费消息

调用消费者的 consumeMessage() 能拉取一批消息。在拉取消息并被使用后,需要调用 ackMessages() 对消息的消费状态进行确认,未被确认或确认消费失败的消息都会被重复消费。

进阶指引

持续生产消息

服务端会对每一个客户端创建一个生产者实例,在客户端生产频率较低时,可能会出现服务端生产者实例被释放导致生产消息失败的情况。

所以在持续生产消息时需要捕获这类异常并重新调用 open() 方法重新在服务端开启一个生产者实例,SDK 提供了一个专门用来捕获该类错误的Exception在RMQ\Exception\MQTokenTimeoutException 。如下demo,对部分消息等待一个很长的时间,这些消息发送时就会捕获到超时错误。

持续消费消息

持续消息实际上就是一个轮询不断拉取消息,如果每次拉取消息的间隔过长也可能出现超时的情况,所以也需要捕获超时错误并重新调用 open() 方法。

延时消息

延时是消息的一个属性,可通过Message类的putProperty()方法来设置消息的延时属性。

定时投递消息

通过指定的具体的毫秒时间戳定时投递消息。

延时等级消息

Message 类有 setDelayLevel() 方法可设置消息的延时属性。可设置1-18等级.

setDelayLevel() 方法背后实际上使用的还是putProperty()方法。使用setDelayLevel() 实际效果和下面一致。


All versions of ve-rocketmq-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
guzzlehttp/guzzle Version >=6.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package volcengine/ve-rocketmq-php-sdk contains the following files

Loading the files please wait ....