Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Events can be notified or published to external systems from WSO2 servers using event publishers. Event publishers enable you to manage event publishing and notifications. They allow publishing events via multiple transports in JSON, XML, Map, text, and WSO2Event formats to various endpoints and data stores.

Table of Contents
maxLevel3

Event publisher types
Anchor
Event Publisher Types
Event Publisher Types

Event publishers publish events via various transport protocols. These transports are implemented as output event adapters. Following are the adapters that are available by default. You can write extensions to support other transports.

Event publisher configuration

An event publisher configuration has four main sections as follows. 

...

SectionDescription
FromThe event stream from which the event publisher will fetch the events for publishing.
ToAn output event adapter(transport) configuration that is used to send the events to.
Adapter properties

Output event adapters contain three types of adapter properties in their configuration as explained below.

  • Static Adapter Properties : You can add these properties via the management console. You cannot change them based on the event.
  • Dynamic Adapter Properties : You can add these properties via the management console. You can change them for each event by adding event attributes as follows: {{ attribute }} E.g.  http://localhost:8000/endpoint/{{endpointId}} 
  • Global Adapter Properties : These properties come from the <PRODUCT_HOME>/repository/conf/output-event-adapters.xml file. They are common for all adapters on its kind which was defined during the event publisher creation.
Mapping configurationThe format of the message that needs to be sent. You can configure custom mappings on the selected format via advanced settings.

Anchor
Creating event publishers
Creating event publishers
Creating event publishers

You can create event publishers either  using the management console  or  using a configuration file  as explained below.

Anchor
Creating publishers using the management console
Creating publishers using the management console
Creating publishers using the management console 

Follow the steps below to create an event publisher using the management console of WOS2 CEP/DAS.

...

  1. Log in to the management console, and click Main.
  2. Click Publishers in the Event menu, and then click Add Event Publisher.
  3. Enter a name for Event Publisher Name. (Do not use spaces between the words in the name of the event publisher.)

  4. Select the Event Source with the published events.

  5. You view the Stream Attributes of the selected event source. You cannot edit the attributes of a created event stream in here. 
  6. Select the output transport to which you want to publish events for the Output Event Adapter Type, and enter the Adapter Properties accordingly. For instructions on the adapter properties of output transport types, see Event Publisher Types.

  7. Select the Message Format which you want to apply on the published events. WSO2 servers allow users to configure events in XML, JSON, Text, Map, and WSO2Event event formats.

  8. Click Advanced to define custom output mappings based on the message format you selected, if you want to publish events that do not adhere to the /wiki/spaces/TESB/pages/32604416. For more information on custom input mapping types, see Publishing Events in Various Event Formats.
  9. Click  Add Event Publisher ,   to create the event publisher in the system.  When you click  OK   in the pop-up message on successful addition of the event publisher, you view it in the  Available Event Publishers    list as shown below.  
    list of all existing event publishers

Anchor
Creating publishers using a configuration file
Creating publishers using a configuration file
Creating publishers using a configuration file

Follow the steps below to create an event publisher using a configuration file.

...

After a publisher is successfully added, it gets added to the list of publisher displayed under Event in the Main menu of the product's management console. ClickEdit to change its configuration and redeploy it. This opens an XML-based editor allowing you to edit the event adapter configurations from the UI. Do your modifications and click Update. You can also delete it, enable/disable statistics or enable/disable tracing on it using the provided options in the UI as described below.

Enabling statistics for event publishers

Follow the steps below to enable monitoring statistics of events published by an existing event publisher.

...

  1. Log in to the management console, and click Main.
  2. Click Publishers in the Event menu. You view the Available Event Publishers list.
  3. Click the Enable Statistics button of the corresponding event publisher to enable monitoring event statistics for it.

Enabling tracing for event publishers

Follow the steps below to enable tracing on events published by an existing event publisher.

...

  1. Log in to the management console, and click Main.
  2. Click Publishers  in the Event menu. You view the Available Event Publishers  list.
  3. Click the Enable Tracing button of the corresponding event publisher to enable event tracing for it. 

Deleting event publishers

Follow the steps below to delete an existing event publisher.

  1. Log in to the management console, and click Main.
  2. Click  Publishers  in the Event menu. You view the Available Event Publishers  list.
  3. Click the Delete button of the corresponding event publishe r to delete it.

Editing event publishers

Follow the steps below to edit an existing event publisher.

...