Skip to main content

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.

ClassSerde
java.time.Instantcom.paiondata.elide.core.utils.coerce.converters.InstantSerde
java.time.OffsetDateTimecom.paiondata.elide.core.utils.coerce.converters.OffsetDateTimeSerde
java.util.TimeZonecom.paiondata.elide.core.utils.coerce.converters.TimeZoneSerde
java.net.URLcom.paiondata.elide.core.utils.coerce.converters.URLSerde
java.util.Datecom.paiondata.elide.core.utils.coerce.converters.ISO8601DateSerde
java.sql.Datecom.paiondata.elide.core.utils.coerce.converters.ISO8601DateSerde
java.sql.Timecom.paiondata.elide.core.utils.coerce.converters.ISO8601DateSerde
java.sql.Timestampcom.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

NameDescriptionDefault Value
elide.base-urlThe base service URL that clients use in queries.
elide.default-page-sizeDefault pagination size for collections if the client doesn't set the pagination size.500
elide.max-page-sizeThe maximum pagination size a client can request.10000
elide.verbose-errorsTurns on/off verbose error responses.false
elide.strip-authorization-headersRemove Authorization headers from RequestScope to prevent accidental logging of security credentials.true

API Versioning Strategy Properties

NameDescriptionDefault Value
elide.api-versioning-strategy.path.enabledWhether or not the path based strategy is enabled.true
elide.api-versioning-strategy.path.version-prefixThe version prefix to use. For instance /v1/resource.v
elide.api-versioning-strategy.header.enabledWhether or not the header based strategy is enabled.false
elide.api-versioning-strategy.header.header-nameThe header names that contains the API version. For instance Accept-Version or ApiVersion.Accept-Version
elide.api-versioning-strategy.parameter.enabledWhether or not the parameter based strategy is enabled.false
elide.api-versioning-strategy.parameter.parameter-nameThe parameter name that contains the API version.v
elide.api-versioning-strategy.media-type-profile.enabledWhether or not the media type profile based strategy is enabled.false
elide.api-versioning-strategy.media-type-profile.version-prefixThe version prefix to use for the version.v
elide.api-versioning-strategy.media-type-profile.uri-prefixThe uri prefix to use to determine the profile that contains the API version.

JSON-API Properties

NameDescriptionDefault Value
elide.json-api.enabledWhether or not the controller is enabled.false
elide.json-api.pathThe URL path prefix for the controller./
elide.json-api.links.enabledTurns on/off JSON-API links in the API.false

GraphQL Properties

NameDescriptionDefault Value
elide.graphql.enabledWhether or not the controller is enabled.false
elide.graphql.pathThe URL path prefix for the controller./
elide.graphql.federation.enabledTurns on/off Apollo federation schema.false
elide.graphql.subscription.enabledWhether or not the controller is enabled.false
elide.graphql.subscription.pathThe URL path prefix for the controller./
elide.graphql.subscription.send-ping-on-subscribeWebsocket sends a PING immediate after receiving a SUBSCRIBE.false
elide.graphql.subscription.connection-timeoutTime allowed from web socket creation to successfully receiving a CONNECTION_INIT message.5000ms
elide.graphql.subscription.idle-timeoutMaximum idle timeout in milliseconds with no websocket activity.300000ms
elide.graphql.subscription.max-subscriptionsMaximum number of outstanding GraphQL queries per websocket.30
elide.graphql.subscription.max-message-sizeMaximum message size that can be sent to the websocket.10000
elide.graphql.subscription.publishing.enabledWhether Elide should publish subscription notifications to JMS on lifecycle events.false

API Docs Properties

NameDescriptionDefault Value
elide.api-docs.enabledWhether or not the controller is enabled.false
elide.api-docs.pathThe URL path prefix for the controller./
elide.api-docs.versionThe OpenAPI Specification Version to generate.openapi-3-0

Async Properties

NameDescriptionDefault Value
elide.async.enabledWhether or not the async feature is enabled.false
elide.async.thread-pool-sizeDefault thread pool size.5
elide.async.max-async-afterDefault maximum permissible time to wait synchronously for the query to complete before switching to asynchronous mode.10s
elide.async.cleanup.enabledWhether or not the cleanup is enabled.false
elide.async.cleanup.query-max-run-timeMaximum query run time.3600s
elide.async.cleanup.query-retention-durationRetention period of async query and results before being cleaned up.7d
elide.async.cleanup.query-cancellation-check-intervalPolling interval to identify async queries that should be canceled.300s
elide.async.export.enabledWhether or not the controller is enabled.false
elide.async.export.pathThe URL path prefix for the controller./export
elide.async.export.append-file-extensionEnable Adding Extension to table export attachments.false
elide.async.export.storage-destinationStorage engine destination./tmp
elide.async.export.format.csv.write-headerGenerates the header in a CSV formatted export.true

Aggregation Store Properties

NameDescriptionDefault Value
elide.aggregation-store.enabledWhether or not aggregation data store is enabled.false
elide.aggregation-store.default-dialectSQLDialect type for default DataSource Object.Hive
elide.aggregation-store.query-cache.enabledWhether or not to enable the query cache.true
elide.aggregation-store.query-cache.expirationQuery cache expiration after write.10m
elide.aggregation-store.query-cache.max-sizeLimit on number of query cache entries.1024
elide.aggregation-store.metadata-store.enabledWhether or not meta data store is enabled.false
elide.aggregation-store.dynamic-config.enabledWhether or not dynamic model config is enabled.false
elide.aggregation-store.dynamic-config.pathThe path where the config hjsons are stored./
elide.aggregation-store.dynamic-config.config-api.enabledEnable support for reading and manipulating HJSON configuration through Elide models.false

JPA Store Properties

NameDescriptionDefault Value
elide.jpa-store.delegate-to-in-memory-storeWhen 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 nanoseconds
  • us for microseconds
  • ms for milliseconds
  • s for seconds
  • m for minutes
  • h for hours
  • d for days

Standalone

Settings

The configuration for the Elide Standalone is implemented using interfaces.

InterfaceDescription
com.paiondata.elide.standalone.config.ElideStandaloneSettingsElide core configuration and JSON-API, GraphQL and OpenAPI API Documentation and all other settings.
com.paiondata.elide.standalone.config.ElideStandaloneSubscriptionSettingsGraphQL Subscriptions configuration.
com.paiondata.elide.standalone.config.ElideStandaloneAnalyticSettingsAnalytic configuration.
com.paiondata.elide.standalone.config.ElideStandaloneAsyncSettingsAsync configuration.