Working with Events
GridGain can generate events for a variety of operations happening in the cluster and notify your application about those operations. There are many types of events, including cache events, node discovery events, distributed task execution events, and many more.
Enabling Events
Creating Event Channel
In GridGain 9, events are configured cluster-wide, in cluster configuration. Events are organized in channels, each channel tracking one or more event types. You cannot enable or disable individual events, instead you need to disable event channels.
To create an event channel:
cluster config update ignite.eventlog.channels.exampleChannel.events=["USER_AUTHENTICATION_SUCCESS"]
This channel will track the USER_AUTHENTICATION_SUCCESS, but not trigger yet. For the events to trigger, an event sink must be configured. A single event channel can be connected to any number of sinks.
Creating Event Sink
An event sink handles events and sends them to the user. Here is how you can enable a simple log sink by using the CLI tool:
cluster config update ignite.eventlog.sinks.exampleSink = {type="log", channel="exampleChannel"}
This sink sends the event information to the configured logger category at the configured level. Now, the authorization events will be written to the log. Here is how the event may look like:
2024-06-04 16:19:29:840 +0300 [INFO][%defaultNode%sql-execution-pool-1][EventLog] {"type":"USER_AUTHORIZATION_SUCCESS","timestamp":1717507169840,"productVersion":"{version}","user":{"username":"ignite","authenticationProvider":"basic"},"fields":{"privileges":[{"action":"CREATE_TABLE","on":{"objectType":"TABLE","objectName":"TEST2","schema":"PUBLIC"}}],"roles":["system"]}}
Below is the cluster configuration config in JSON.
{
"ignite" : {
"eventlog" : {
"channels" : [ {
"enabled" : true,
"events" : [ "USER_AUTHENTICATION_SUCCESS" ],
"name" : "exampleChannel"
} ],
"sinks" : [ {
"channel" : "exampleChannel",
"criteria" : "EventLog",
"format" : "JSON",
"level" : "INFO",
"name" : "sampleSink",
"type" : "log"
} ]
}
}
}
Event Sinks
Log Sink
This sink prints information to the log, using the configured logging level.
{
"ignite" : {
"eventlog" : {
"sinks" : [ {
"name" : "sampleSink",
"type" : "log",
"channel" : "exampleChannel",
"criteria" : "EventLog",
"format" : "JSON",
"level" : "INFO"
} ]
}
}
}
| Field | Description |
|---|---|
channel |
The name of the event channel the data sink logs data for. |
criteria |
Logging criteria. By default, only EventLog messages are logged. |
format |
Output format. Currently, only |
level |
The level the messages are posted to the log at. Supported values: |
name |
Arbitrary sink name. |
type |
Type of event sink. Currently, only |
Webhook Sink
Webhook sink sends event data to an HTTP or HTTPS endpoint. Events from the channel are first put into internal queue, and then batched and sent as JSON arrays via HTTP POST requests.
{
"ignite" : {
"eventlog" : {
"sinks" : [ {
"name" : "sampleWebhook",
"type" : "webhook",
"channel" : "exampleChannel",
"endpoint" : "http://example.com:443",
"protocol" : "http/json",
"batchSize" : 500,
"batchSendFrequencyMillis" : 5000,
"queueSize" : 5000,
"retryPolicy" : {
"maxAttempts" : 3,
"initBackoffMillis" : 2000,
"maxBackoffMillis" : 10000,
"backoffMultiplier" : 2
},
"ssl" : {
"enabled" : true,
"clientAuth" : "none",
"ciphers" : "",
"keyStore" : {
"type" : "PKCS12",
"path" : "/path/to/keystore.p12",
"password" : "keystorePassword"
},
"trustStore" : {
"type" : "PKCS12",
"path" : "/path/to/truststore.p12",
"password" : "truststorePassword"
}
}
} ]
}
}
}
| Parameter | Default | Description |
|---|---|---|
|
Required. Must be |
|
|
Required. Name of the event channel. |
|
|
Required. HTTP or HTTPS endpoint in |
|
|
|
Protocol for sending events. Only |
|
|
Maximum number of events per batch. When this limit is reached, the batch is sent immediately. Minimum value: 1. |
|
|
Maximum time to wait before sending a batch in milliseconds. Batches are sent when either this time limit or |
|
|
Maximum number of events that can be queued. If the queue is full, new events are dropped. Should be higher than |
|
|
Maximum number of retry attempts. 0 means retries are disabled. |
|
|
Initial delay in milliseconds before the first retry attempt. Minimum value: 1. |
|
|
Maximum delay in milliseconds between retry attempts. Minimum value: 1. |
|
|
Multiplier applied to the backoff delay after each failed attempt. Minimum value: 1. |
|
|
Defines if SSL is enabled. |
|
|
Client authentication mode. Possible values: |
|
Comma-separated list of ciphers. Empty string uses default ciphers. |
|
|
|
Keystore type. |
|
Path to the keystore file. |
|
|
Password for the keystore. |
|
|
|
Truststore type. |
|
Path to the truststore file. |
|
|
Password for the truststore. |
HTTP Request Format
Every HTTP request sent by the webhook sink includes the following headers:
| Header | Description |
|---|---|
|
Always set to |
|
The UUID of the Ignite cluster sending the events. |
|
The name of the specific Ignite node that sent the batch. |
Expected Response Codes
The webhook endpoint must return the following codes:
-
2xx(200-299) - Success, batch accepted -
429- Too Many Requests -
502- Bad Gateway -
503- Service Unavailable -
504- Gateway Timeout
In case one of the above codes is received, GridGain will attempt to retry sending the batch according to retryPolicy configuration. Any other status code is treated as permanent failure, and no retry attempts are made.
Event Channels
Event channel configuration in GridGain 9 has the following structure:
{
"ignite" : {
"eventlog" : {
"channels" : [ {
"enabled" : true,
"events" : [ "USER_AUTHENTICATION_SUCCESS" ],
"name" : "exampleChannel"
} ]
}
}
}
| Field | Description |
|---|---|
enabled |
Defines if this event channel is enabled. |
events |
The list of events tracked by the event channel. For the full list of event types, see Events List. |
name |
Arbitrary channel name. |
Event Structure
All events in GridGain 9 follow the same basic structure described below. Some events provide additional context in the data field.
{
"type": "AUTHORIZATION",
"user": { "username": "John", "authenticationProvider": "basic" },
"timestamp": 1715169617,
"productVersion": "3.0.0",
"fields": {}
}
| Field | Description |
|---|---|
type |
The type of the event. For the full list of event types, see Events List. |
user |
The name of the user, and the authentication provider used to authorize. |
timestamp |
Even time in UNIX epoch time. |
productVersion |
GridGain version used by the client. |
fields |
Event-specific data. |
© 2025 GridGain Systems, Inc. All Rights Reserved. Privacy Policy | Legal Notices. GridGain® is a registered trademark of GridGain Systems, Inc.
Apache, Apache Ignite, the Apache feather and the Apache Ignite logo are either registered trademarks or trademarks of The Apache Software Foundation.