Configuration
Spring Boot
The configuration for Elide Spring Boot is implemented using auto-configuration classes which reads configuration properties that can be configured using Spring Boot's externalized configuration feature.
The configuration properties do not expose all the settings that can be customized. Some require overriding of the beans
being generated by the auto-configuration classes or by defining customizer beans that can make specific changes to the
auto-configured defaults. Where more than one customizer is defined they will be applied following the @Order
annotation.
Elide
Elide uses ElideSettings
for configuring various aspect of how Elide runs. This is auto-configured in
ElideAutoConfiguration
.
This can be customized by defining a ElideSettingsBuilderCustomizer
.
@Configuration
public class ElideConfiguration {
@Bean
public ElideSettingsBuilderCustomizer elideSettingsBuilderCustomizer() {
return builder -> builder.auditLogger(new MyCustomAuditLogger());
}
}
Custom Serializers and Deserializers
By default serdes for the following are added to the auto-configured SerdesBuilder
.
Class | Serde |
---|---|
java.time.Instant | com.paiondata.elide.core.utils.coerce.converters.InstantSerde |
java.time.OffsetDateTime | com.paiondata.elide.core.utils.coerce.converters.OffsetDateTimeSerde |
java.util.TimeZone | com.paiondata.elide.core.utils.coerce.converters.TimeZoneSerde |
java.net.URL | com.paiondata.elide.core.utils.coerce.converters.URLSerde |
java.util.Date | com.paiondata.elide.core.utils.coerce.converters.ISO8601DateSerde |
java.sql.Date | com.paiondata.elide.core.utils.coerce.converters.ISO8601DateSerde |
java.sql.Time | com.paiondata.elide.core.utils.coerce.converters.ISO8601DateSerde |
java.sql.Timestamp | com.paiondata.elide.core.utils.coerce.converters.ISO8601DateSerde |
This can be customized by defining a SerdesBuilderCustomizer
. If the defaults are not required the existing serdes can
be cleared.
@Configuration
public class ElideConfiguration {
@Bean
public SerdesBuilderCustomizer serdesBuilderCustomizer() {
return builder -> builder.clear().entry(Address.class, new AddressSerde());
}
}
This can also be customized by defining a ElideSettingsBuilderCustomizer
.
@Configuration
public class ElideConfiguration {
@Bean
public ElideSettingsBuilderCustomizer elideSettingsBuilderCustomizer() {
return builder -> builder.serdes(serdes -> serdes.entry(Address.class, new AddressSerde()));
}
}
JSON API
Elide uses JsonApiSettings
for configuring JSON-API. This is auto-configured in ElideAutoConfiguration
.
This can be customized by defining a JsonApiSettingsBuilderCustomizer
. The following configures the use of JSON-API
links in results.
@Configuration
public class ElideConfiguration {
@Bean
public JsonApiSettingsBuilderCustomizer jsonApiSettingsBuilderCustomizer() {
return builder -> builder.links(links -> links.enabled(true).jsonApiLinks(new MyCustomJsonApiLinks()));
}
}
The following configures the filter dialect.
@Configuration
public class ElideConfiguration {
@Bean
public JsonApiSettingsBuilderCustomizer jsonApiSettingsBuilderCustomizer(EntityDictionary entityDictionary) {
return builder -> builder
.joinFilterDialect(RSQLFilterDialect.builder().dictionary(entityDictionary).build())
.subqueryFilterDialect(RSQLFilterDialect.builder().dictionary(entityDictionary).build());
}
}
Controller
Elide auto-configures a JsonApiController
in ElideAutoConfiguration
. This can be overridden by defining a bean with
the name jsonApiController
. The custom controller does not need to extend JsonApiController
.
@Configuration
public class ElideConfiguration {
@Bean
public MyCustomJsonApiController jsonApiController() {
return new MyCustomJsonApiController();
}
}
GraphQL
Elide uses GraphQLSettings
for configuring GraphQL. This is auto-configured in ElideAutoConfiguration
.
This can be customized by defining a GraphQLSettingsBuilderCustomizer
. The following configures the use of Federation.
@Configuration
public class ElideConfiguration {
@Bean
public GraphQLSettingsBuilderCustomizer graphqlSettingsBuilderCustomizer() {
return builder -> builder.federation(federation -> federation.enabled(true));
}
}
Controller
Elide auto-configures a GraphQLController
in ElideAutoConfiguration
. This can be overridden by defining a bean with the name graphqlController
. The custom controller does not need to extend GraphQLController
.
@Configuration
public class ElideConfiguration {
@Bean
public MyCustomGraphQLController graphqlController() {
return new MyCustomGraphQLController();
}
}
Async
Elide uses AsyncSettings
for configuring Async. This is auto-configured in ElideAutoConfiguration
.
This can be customized by defining a AsyncSettingsBuilderCustomizer
. The following configures export.
@Configuration
public class ElideConfiguration {
@Bean
public AsyncSettingsBuilderCustomizer asyncSettingsBuilderCustomizer() {
return builder -> builder.export(export -> export.enabled(true).path("/export"));
}
}
API Docs
Controller
Elide auto-configures a ApiDocsController
in ElideAutoConfiguration
. This can be overridden by defining a bean with the name graphqlController
. The custom controller does not need to extend ApiDocsController
.
@Configuration
public class ElideConfiguration {
@Bean
public MyApiDocsController apiDocsController() {
return new MyCustomApiDocsController();
}
}
Core Properties
Name | Description | Default Value |
---|---|---|
elide.base-url | The base service URL that clients use in queries. | |
elide.default-page-size | Default pagination size for collections if the client doesn't set the pagination size. | 500 |
elide.max-page-size | The maximum pagination size a client can request. | 10000 |
elide.verbose-errors | Turns on/off verbose error responses. | false |
elide.strip-authorization-headers | Remove Authorization headers from RequestScope to prevent accidental logging of security credentials. | true |
API Versioning Strategy Properties
Name | Description | Default Value |
---|---|---|
elide.api-versioning-strategy.path.enabled | Whether or not the path based strategy is enabled. | true |
elide.api-versioning-strategy.path.version-prefix | The version prefix to use. For instance /v1/resource . | v |
elide.api-versioning-strategy.header.enabled | Whether or not the header based strategy is enabled. | false |
elide.api-versioning-strategy.header.header-name | The header names that contains the API version. For instance Accept-Version or ApiVersion . | Accept-Version |
elide.api-versioning-strategy.parameter.enabled | Whether or not the parameter based strategy is enabled. | false |
elide.api-versioning-strategy.parameter.parameter-name | The parameter name that contains the API version. | v |
elide.api-versioning-strategy.media-type-profile.enabled | Whether or not the media type profile based strategy is enabled. | false |
elide.api-versioning-strategy.media-type-profile.version-prefix | The version prefix to use for the version. | v |
elide.api-versioning-strategy.media-type-profile.uri-prefix | The uri prefix to use to determine the profile that contains the API version. |
JSON-API Properties
Name | Description | Default Value |
---|---|---|
elide.json-api.enabled | Whether or not the controller is enabled. | false |
elide.json-api.path | The URL path prefix for the controller. | / |
elide.json-api.links.enabled | Turns on/off JSON-API links in the API. | false |
GraphQL Properties
Name | Description | Default Value |
---|---|---|
elide.graphql.enabled | Whether or not the controller is enabled. | false |
elide.graphql.path | The URL path prefix for the controller. | / |
elide.graphql.federation.enabled | Turns on/off Apollo federation schema. | false |
elide.graphql.subscription.enabled | Whether or not the controller is enabled. | false |
elide.graphql.subscription.path | The URL path prefix for the controller. | / |
elide.graphql.subscription.send-ping-on-subscribe | Websocket sends a PING immediate after receiving a SUBSCRIBE. | false |
elide.graphql.subscription.connection-timeout | Time allowed from web socket creation to successfully receiving a CONNECTION_INIT message. | 5000ms |
elide.graphql.subscription.idle-timeout | Maximum idle timeout in milliseconds with no websocket activity. | 300000ms |
elide.graphql.subscription.max-subscriptions | Maximum number of outstanding GraphQL queries per websocket. | 30 |
elide.graphql.subscription.max-message-size | Maximum message size that can be sent to the websocket. | 10000 |
elide.graphql.subscription.publishing.enabled | Whether Elide should publish subscription notifications to JMS on lifecycle events. | false |
API Docs Properties
Name | Description | Default Value |
---|---|---|
elide.api-docs.enabled | Whether or not the controller is enabled. | false |
elide.api-docs.path | The URL path prefix for the controller. | / |
elide.api-docs.version | The OpenAPI Specification Version to generate. | openapi-3-0 |
Async Properties
Name | Description | Default Value |
---|---|---|
elide.async.enabled | Whether or not the async feature is enabled. | false |
elide.async.thread-pool-size | Default thread pool size. | 5 |
elide.async.max-async-after | Default maximum permissible time to wait synchronously for the query to complete before switching to asynchronous mode. | 10s |
elide.async.cleanup.enabled | Whether or not the cleanup is enabled. | false |
elide.async.cleanup.query-max-run-time | Maximum query run time. | 3600s |
elide.async.cleanup.query-retention-duration | Retention period of async query and results before being cleaned up. | 7d |
elide.async.cleanup.query-cancellation-check-interval | Polling interval to identify async queries that should be canceled. | 300s |
elide.async.export.enabled | Whether or not the controller is enabled. | false |
elide.async.export.path | The URL path prefix for the controller. | /export |
elide.async.export.append-file-extension | Enable Adding Extension to table export attachments. | false |
elide.async.export.storage-destination | Storage engine destination. | /tmp |
elide.async.export.format.csv.write-header | Generates the header in a CSV formatted export. | true |
Aggregation Store Properties
Name | Description | Default Value |
---|---|---|
elide.aggregation-store.enabled | Whether or not aggregation data store is enabled. | false |
elide.aggregation-store.default-dialect | SQLDialect type for default DataSource Object. | Hive |
elide.aggregation-store.query-cache.enabled | Whether or not to enable the query cache. | true |
elide.aggregation-store.query-cache.expiration | Query cache expiration after write. | 10m |
elide.aggregation-store.query-cache.max-size | Limit on number of query cache entries. | 1024 |
elide.aggregation-store.metadata-store.enabled | Whether or not meta data store is enabled. | false |
elide.aggregation-store.dynamic-config.enabled | Whether or not dynamic model config is enabled. | false |
elide.aggregation-store.dynamic-config.path | The path where the config hjsons are stored. | / |
elide.aggregation-store.dynamic-config.config-api.enabled | Enable support for reading and manipulating HJSON configuration through Elide models. | false |
JPA Store Properties
Name | Description | Default Value |
---|---|---|
elide.jpa-store.delegate-to-in-memory-store | When fetching a subcollection from another multi-element collection, whether or not to do sorting, filtering and pagination in memory. | true |
Converting Durations
The properties indicating a duration are specified using java.time.Duration
. For instance a configuration value of
7d
indicates 7 days and 300s
indicates 300 seconds.
The following are the supported units
ns
for nanosecondsus
for microsecondsms
for millisecondss
for secondsm
for minutesh
for hoursd
for days
Standalone
Settings
The configuration for the Elide Standalone is implemented using interfaces.
Interface | Description |
---|---|
com.paiondata.elide.standalone.config.ElideStandaloneSettings | Elide core configuration and JSON-API, GraphQL and OpenAPI API Documentation and all other settings. |
com.paiondata.elide.standalone.config.ElideStandaloneSubscriptionSettings | GraphQL Subscriptions configuration. |
com.paiondata.elide.standalone.config.ElideStandaloneAnalyticSettings | Analytic configuration. |
com.paiondata.elide.standalone.config.ElideStandaloneAsyncSettings | Async configuration. |