GithubHelp home page GithubHelp logo

bimbus / mq-client-akeneo Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 25 KB

A Message Queue bundle for the Akeneo PIM

License: Apache License 2.0

PHP 100.00%
mq message-queue akeneo-pim pim gcp-pubsub esb bim

mq-client-akeneo's Introduction

MQ Client for Akeneo

A Message Queue bundle for the Akeneo PIM

Principle

This simple bundle allows to push a message to a Google Cloud Pub/Sub topic each time a product is modified.

Use case

Combined with other services orchestrated from an ESB, this allows to asynchronously process changes (BLOB for examples) and push them back to the PIM or to any other application (catalog, etc)

We use this in a BIM environment to parse ArchiCAD 3D .gsm model files and inject the PIM data to generate up to date versions of 3D furniture libraries.

Installation

From your PIM project root folder, clone the repository:

git clone https://github.com/bimbus/mq-client-akeneo src/Bimbus

Then add the needed dependencies:

composer require google/cloud-pubsub

Edit the app/AppKernel.php file to reflect this:

    protected function registerProjectBundles()
    {
        return [
          new Bimbus\Bundle\MQBundle\BimbusMQBundle(),
        ];
    }

Empty your cache:

bin/console cache:clear --env=prod

Google Cloud Pub/Sub

Select or create the project. If this is a creation, activate the Pub/sub API.

Create a service account

  • Select the IAM & admin > Service accounts menu item then click on CREATE SERVICE ACCOUNT.
  • Type in a name for the new service account (eg. akeneo-mq) and check the Furnish a new private key checkbox.
  • Click on "CREATE", the JSON credentials file should be downloaded automatically.
  • Rename the downloaded file to gcp-credentials.json and put it in the src/Bimbus/config folder.

Create a topic

  • Go to the Pub/Sub > Topics menu and then click on CREATE TOPIC.
  • On the next screen, select the newly created topic.
  • Then, type in the name of the new service account your just created and give it the "Pub/Sub Publisher" Role.

Create a subscription

  • Return to the Pub/Sub > Topics menu.
  • Click the button at the end of the created topic line and select New subscription.
  • Enter a name and click on create.

Bundle configuration

  • Move into the src/Bimbus/Bundle/MQBundle/Resources/config/ folder.
  • Copy the parameters.yml.dist to parameters.yml.
  • Edit the parameters.yml file to fill in the gcp.pubsub.project and gcp.pubsub.topic keys:
parameters:
    gcp.pubsub.project: '<<gcp-project-id>>'
    gcp.pubsub.topic: '<<last-part-of-topic>>'
    gcp.pubsub.credentials: '%kernel.project_dir%/src/Bimbus/config/gcp-credentials.json'

Test everything

  • Open the Akeneo UI and edit a product to check that saving works fine.
  • Use the gcloud CLI to check that the message as been pushed to the topic:
gcloud config set project <<gcp-project-id>>
gcloud pubsub subscriptions pull <<subscription-name>>

mq-client-akeneo's People

Contributors

crapougnax avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

crapougnax

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.