Elasticsearch Registry & Components
Many of the shipped configurations make use of variable substitution to reduce repetition. |
Apiman components for Elasticsearch.
Global Required Parameters
Name | Type | Description |
---|---|---|
|
String |
The Elasticsearch client type:
|
|
Enum |
The Elasticsearch protocol to use
|
|
String |
Elasticsearch index prefix
|
|
String |
The ES host |
|
Integer |
The ES port |
|
Integer |
Client timeout (milliseconds)
|
Global Optional Parameters
Name | Type | Description |
---|---|---|
|
String |
An alternative Elasticsearch index name. |
|
Boolean |
Initialise the storage |
|
String |
Username if using an auth mechanism like SearchGuard, Shield, etc |
|
String |
Password if using an auth mechanism like SearchGuard, Shield, etc |
|
String |
Path to the client KeyStore |
|
Enum |
Format of keystore
|
|
String |
Password for the client KeyStore |
|
String |
Path to the TrustStore |
|
Enum |
Format of truststore
|
|
String |
Password for the TrustStore |
|
Boolean |
Trust self-signed certificates
|
|
Boolean |
Disable hostname verification checks
|
|
Boolean |
Trust all SSL endpoints without any checks (use with great care)
|
|
String |
Polling frequency for client attempting connection to Elasticsearch (milliseconds). This is only relevant if the client is unable to connect on first attempt.
|
Registry
Assign your chosen implementation as shown in the example, providing configuration.
Implementation | Notes |
---|---|
|
Recommended. Works well in multi-node setups. |
|
Works well in single-node setups. |
|
Only recommended for very low volume or test setups; causes remote calls to be issued on every request. |
Required Parameters
Refer also to Global Required Parameters.
Name | Type | Description |
---|---|---|
|
Integer |
Cache polling interval in seconds.
|
Optional Parameters
Refer also to Global Optional Parameters.
Name | Type | Description |
---|---|---|
|
Integer |
Polling startup delay in seconds.
|
Metrics
Set the metrics implementation as shown.
apiman-gateway.metrics=io.apiman.gateway.engine.es.ESMetrics
{
"metrics": {
"class": "io.apiman.gateway.engine.es.ESMetrics",
"config": {
"client": {
"type": "es",
"protocol": "${apiman.es.protocol}",
"host": "${apiman.es.host}",
"port": "${apiman.es.port}"
// <metrics configuration>
}
}
}
}
Set the Apiman Manager metrics accessor implementation to enable Apiman Manager UI to provide some basic visualisations from your Elasticsearch data.
# API Manager metrics settings.
apiman-manager.metrics.type=io.apiman.manager.api.es.EsMetricsAccessor
apiman-manager.metrics.es.client.type=es
# All options available as in global mandatory and optional
apiman-manager.metrics.es.client.protocol=${apiman.es.protocol}
apiman-manager.metrics.es.client.host=${apiman.es.host}
apiman-manager.metrics.es.client.port=${apiman.es.port}
Optional Parameters
Refer also to Global Required Parameters.
Name | Type | Description |
---|---|---|
|
Integer |
Maximum metrics queue size
|
|
Integer |
Maximum metrics batching size
|
|
String[] |
Case-insensitive list of request headers to capture, for example |
|
String[] |
Case-insensitive list of response headers to capture |
|
String[] |
Case-insensitive list of HTTP query parameters to capture |
|
String[] |
Case-insensitive list of destinations to write Elasticsearch logs. Rather than solely pushing metrics directly to the Elasticsearch server, Apiman can also write the metrics to a log file as JSON (e.g. for scraping).
|
For custom header and query param capture, we add entries into the Elasticsearch index dynamically using dynamic templates. |
Components
Shared State
Set shared state implementation as shown.
apiman-gateway.components.ISharedStateComponent=io.apiman.gateway.engine.es.ESSharedStateComponent
apiman-gateway.components.ISharedStateComponent.client.type=es
# <other configuration options>
{
"components": {
// Shared State Component Settings
"ISharedStateComponent": {
"class": "io.apiman.gateway.engine.es.ESSharedStateComponent",
"config": {
"client": {
"type": "es",
"protocol": "${apiman.es.protocol}",
"host": "${apiman.es.host}",
"port": "${apiman.es.port}"
//<configuration options>
}
}
}
}
}
Required Parameters
Refer to Global Required Parameters.
Rate Limiter
Set rate limiter implementation as shown.
apiman-gateway.components.IRateLimiterComponent=io.apiman.gateway.engine.es.ESRateLimiterComponent
apiman-gateway.components.IRateLimiterComponent.client.type=es
# <configuration options>
{
"components": {
// Rate Limiter Component Settings
"IRateLimiterComponent": {
"class": "io.apiman.gateway.engine.es.ESRateLimiterComponent",
"config": {
"client": {
"type": "es",
"protocol": "${apiman.es.protocol}",
"host": "${apiman.es.host}",
"port": "${apiman.es.port}"
// <configuration options>
}
}
}
}
}
Required Parameters
Refer to Global Required Parameters.
Cache Store
Set cache store implementation as shown.
apiman-gateway.components.ICacheStoreComponent=io.apiman.gateway.engine.es.EsCacheStoreComponent
apiman-gateway.components.ICacheStoreComponent.client.type=es
# <configuration options>
{
"components": {
// Cache Store Component Settings
"ICacheStoreComponent": {
"class": "io.apiman.gateway.engine.es.ESCacheStoreComponent",
"config": {
"client": {
"type": "es",
"protocol": "${apiman.es.protocol}",
"host": "${apiman.es.host}",
"port": "${apiman.es.port}"
// <configuration options>
}
}
}
}
}
Required Parameters
Refer to Global Required Parameters.