Notify is messaging service for Omega2. which responsible for sending message to Alpha or AWS sns based on priority.

Installs: 27

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:symfony-bundle

v1.0.11 2018-03-16 06:56 UTC

This package is not auto-updated.

Last update: 2024-04-21 02:13:46 UTC


README

Printi Aws is common aws service for Printi platform.

Installing AWS as Bundle

The recommended way to install ApiClient is through Composer.

# Install Composer
curl -sS https://getcomposer.org/installer | php

Next, run the Composer command to install the latest stable version of AWS:

php composer.phar require printi/aws

You can then later update notify using composer:

composer.phar update printi/aws

User Guide

Basic notify configuration:

For eg:

printi_aws:
    s3:
        orders_bucket:
            bucket: alpha-upload-dev

    sqs:
        omega_occurrence:
            enable: true
            queue_name: omega-item-occurrence-dev
            queue_url: arn:aws:sqs:sa-east-1:773571409125:omega-item-occurrence-dev
            wait_time_seconds: 1
    sns:
        omega_occurrence:
            enable: true
            topic_arn: arn:aws:sns:sa-east-1:773571409125:omega-item-occurrence-dev
        omega_status_change:
            enable: true
            topic_arn: arn:aws:sns:sa-east-1:773571409125:omega-item-status-change-dev
        om2_item_import_fail:
            enable: true
            topic_arn: arn:aws:sns:sa-east-1:773571409125:om2-item-import-fail-dev
        om2_invalid_item_import:
            enable: true
            topic_arn: arn:aws:sns:sa-east-1:773571409125:om2-invalid-item-import-dev
        alpha_message:
            enable: true
            topic_arn: arn:aws:sns:sa-east-1:773571409125:om2-invalid-item-import-dev```                        


## How to use

We can inject Notify as a service into our application.

for eg:
```php

namespace App;
use Printi\AwsBundle\Sns;

class HelloClass {

    private $snsClient;
    
    public function __construct(Sns $sns)
    {
        $this->snsClient = $sns;
    }
    
    public function onTransitionUpdate()
    {
        $message = [
            "order_item_id" => 11111,
            "transition"    => 'prepress_reject',
            "reference"     => null,
            "status_id"     => 50,
            "version"       => 2,
        ];
        $this->snsClient->publish('alpha_message', $message);
    }
}