承接 mawdoo3-com/waraqa-amq-integration 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mawdoo3-com/waraqa-amq-integration

Composer 安装命令:

composer require mawdoo3-com/waraqa-amq-integration

包简介

This package is callback api to publish articles from waraqa platform

README 文档

README

This package an integration SDK for waraqa services, also it connects to cloudamqp.com the RabbitMQ cloud base service.

To install this package:

composer require mawdoo3com/waraqa-integration

Consumer Usage:

<?php

use Waraqa\Connection\WAMQPConnect;
use PhpAmqpLib\Message\AMQPMessage;
use Waraqa\Consumer;

class WaraqaIntegration
{

    public function execute()
    {
        $client_id = getenv('CLIENT_ID');//will provided by waraqa admin
        $connection_string = getenv('AQMP_CONNECTION');//will provided by waraqa admin
        $connection_obj = new WAMQPConnect($connection_string, $client_id);
        $connection = $connection_obj->connect();

        $consumer = new Consumer();
        $consumer->consume($connection, [$this, 'process']);
    }

    public function process(AMQPMessage $message)
    {
        //your code goes here, this is the callback function
    }
}

Producer Usage:

<?php

use Waraqa\Connection\WAMQPConnect;
use Waraqa\Producer;

class WaraqaIntegration
{

    public function execute()
    {
        $client_id = getenv('CLIENT_ID');//will provided by waraqa admin
        $connection_string = getenv('AQMP_CONNECTION');//will provided by waraqa admin
        $connection_obj = new WAMQPConnect($connection_string, $client_id);
        $connection = $connection_obj->connect();

        $producer = new Producer();
        $producer->produce($connection,'message',[param1,param2,...etc]);
    }
}

统计信息

  • 总下载量: 188
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-01-22