This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Hazlecast Event Table Extension

Connection instructions that can be used with the From annotation: 

cluster.name : Hazelcast cluster name [Optional]  (i.e cluster.name='cluster_a').

cluster.password Hazelcast cluster password [Optional] (i.e cluster.password='pass@cluster_a').

cluster.addresses Hazelcast cluster addresses as a comma separated string [Optional] (i.e cluster.addresses='192.168.1.1:5700,192.168.1.2.5700').


 

Syntax

@from(eventtable = <eventtable type>, [<property name> =  <property value>]*)

[@IndexBy(<attribute name>)]?

define table <table name> ([<attribute name> <attribute type>]+);
Extension TypeEventTable
Description

Hazelcast event tables support persisting event data in a distributed manner using Hazelcast in-memory data grids. This functionality is enabled via the From annotation. This annotation also assigns the instructions for the Hazelcast cluster to the event table.

An event table can be indexed for fast event access using the IndexBy annotation. With IndexBy, only one attribute can be indexed. Once the indexing is done, events are held using a map data structure. Therefore if multiple events are inserted into an event table with the same index value, only the event that was inserted last remains in the table.

Parameters
  • eventtable type: This is a constant value that defines the type of the event table. For Hazelcast event tables, use hazelcast.
  • property name: The hazelcast cluster connection configuration properties. Available properties are as follows.
    • cluster.name: The name of the Hazelcast cluster.
    • cluster.password: The password of the Hazelcast cluster.
    • cluster.addresses: The Hazelcast cluster addresses as a comma separated string.
  • property value: Defines the connection values for each property.
  • table name: Defines the name of the table.
  • attribute name: Defines the table column name.
  • attribute type: Defines the table column type.
ReturnN/A
Examples
  • The following creates an event table named RoomTypeTable with attributes named roomNo (an INT attribute) and type (a STRING attribute), backed by a new Hazelcast Instance.

    @from(eventtable = 'hazelcast')
    define table RoomTypeTable(roomNo int, type string);
  • The following creates an event table named RoomTypeTable with attributes named roomNo (an INT attribute) and type (a STRING attribute), backed by a new Hazelcast Instance in a new Hazelcast Cluster.

    @from(eventtable = 'hazelcast', cluster.name = 'cluster_a', cluster.password = 'pass@cluster_a')
    define table RoomTypeTable(roomNo int, type string);
  • The following creates an event table named RoomTypeTable with attributes named roomNo (an INT attribute) and type (a STRING attribute), backed by an existing Hazelcast Instance in an existing Hazelcast cluster.

    @from(eventtable = 'hazelcast', cluster.name = 'cluster_a', cluster.password = 'pass@cluster_a', cluster.addresses='192.168.1.1:5700,192.168.1.2.5700')
    define table RoomTypeTable(roomNo int, type string);