Download the PHP package opencontent/ocwebhookserver-ls without Composer

On this page you can find all versions of the php package opencontent/ocwebhookserver-ls. 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 ocwebhookserver-ls

ocwebhookserver

Estensione eZ Publish legacy per la configurazione e l'invio di webhook HTTP e messaggi Kafka al verificarsi di eventi sul CMS (pubblicazione, cancellazione, ecc.).


Architettura

Outbox pattern

Ogni evento genera uno o più job scritti in DB con stato PENDING prima che venga tentato qualsiasi invio. Questo garantisce che nessun evento venga perso anche in caso di crash del processo o timeout del broker.

Modalità di invio

Ogni trigger dichiara la propria modalità tramite getQueueHandler():

Modalità Costante Comportamento
Immediata HANDLER_IMMEDIATE Il job viene eseguito subito nel processo corrente. Se fallisce rimane FAILED in DB e il cron lo riprova.
Differita HANDLER_SCHEDULED Il job rimane PENDING in DB; il worker o il cron lo eseguono in background.

Il trigger post_publish usa HANDLER_IMMEDIATE — l'evento Kafka viene inviato in sincrono durante la pubblicazione del contenuto.

Transport: HTTP e Kafka

Il transport è determinato dall'URL configurato nel webhook:

URL Transport
https://esempio.com/webhook HTTP POST via Guzzle
kafka://broker1:9092,broker2:9092/topic Produce su Kafka con header CloudEvents

OCWebHookPusher rileva lo schema dell'URL e instrada il job al transport corretto. La logica di retry è identica per entrambi: se l'invio fallisce il job torna PENDING e viene ripreso dal cron.


Invio su Kafka

I messaggi Kafka seguono il formato CloudEvents 1.0 con binding Kafka: i metadati dell'evento stanno negli header del messaggio, il value contiene solo i dati dell'entità.

Header

Header Valore
ce_specversion 1.0
ce_id UUID v4 generato al produce
ce_type it.opencity.<product>.<domain>.<event> (da KafkaCeTypeMap)
ce_source urn:opencity:<product>:<tenant-uuid>
ce_time ISO 8601 UTC, momento del produce
content-type application/json
oc_app_name nome variante prodotto (es. website-comuni)
oc_app_version versione applicativo
oc_retry_count numero di tentativi precedenti (0 al primo invio)

Payload

Regole di formattazione del payload

Configurazione

L'URL del webhook Kafka va configurato come:


Installazione


Creare un trigger

  1. Implementare OCWebHookTriggerInterface + OCWebHookTriggerQueueAwareInterface
  2. Registrarlo in webhook.ini [TriggersSettings] TriggerList[]
  3. Emettere l'evento nel codice:

getQueueHandler() ha default HANDLER_SCHEDULED. Sovrascriverlo nel trigger se l'invio deve essere sincrono (es. eventi Kafka su pubblicazione).

Vedi eventtypes/event/workflowwebhook/workflowwebhooktype.php come esempio.


Cron jobs

Part Script Funzione
frequent reset_running_jobs.php Riporta in PENDING i job bloccati in RUNNING da più di RunningJobTimeoutSeconds

All versions of ocwebhookserver-ls with dependencies

PHP Build Version
Package Version
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 opencontent/ocwebhookserver-ls contains the following files

Loading the files please wait ...