Skip to main content

Spring starter

Dependencies

libraryDependencies += "fr.maif" % "izanami-spring" % "1.11.0"

Configuration

Settings

KeyDescription
izanami.hostserver address. eg http://localhost:9000
izanami.client-idclient id
izanami.client-secretclient secret
izanami.client-id-header-nameclient id header name
izanami.client-secret-header-nameclient secret header name
izanami.backendUndefined (default) or SseBackend
izanami.page-sizeSize of the pages fetched by the client (default 200)
izanami.zone-idZone id for dates (default: Paris/Europe)
izanami.dispatcherThe akka dispatcher
izanami.feature.strategy.typeDevStrategy, FetchStrategy, FetchWithCacheStrategy, CacheWithSseStrategy or CacheWithPollingStrategy
izanami.feature.strategy.error-strategyCrash or RecoverWithFallback (default)
izanami.feature.strategy.durationFetchWithCacheStrategy duration of the cache. ex: 1 second or 5 minutes
izanami.feature.strategy.max-elementFetchWithCacheStrategy max elements in cache
izanami.feature.strategy.polling-intervalCacheWithSseStrategy or CacheWithPollingStrategy polling interval (optional for CacheWithSseStrategy), ex: 1 second or 5 minutes
izanami.feature.strategy.patternsCacheWithSseStrategy or CacheWithPollingStrategy pattern for keys to keep in cache
izanami.feature.fallbacka json array of features used as fallbacks
izanami.feature.autocreatetrue or false (default)
izanami.config.strategy.typeDevStrategy, FetchStrategy, FetchWithCacheStrategy, CacheWithSseStrategy or CacheWithPollingStrategy
izanami.config.strategy.error-strategyCrash or RecoverWithFallback (default)
izanami.config.strategy.durationFetchWithCacheStrategy duration of the cache. ex: 1 second or 5 minutes
izanami.config.strategy.max-elementFetchWithCacheStrategy max elements in cache
izanami.config.strategy.polling-intervalCacheWithSseStrategy or CacheWithPollingStrategy polling interval (optional for CacheWithSseStrategy), ex: 1 second or 5 minutes
izanami.config.strategy.patternsCacheWithSseStrategy or CacheWithPollingStrategy pattern for keys to keep in cache
izanami.config.fallbacka json array of configs used as fallbacks
izanami.config.autocreatetrue or false (default)
izanami.experiment.fallbacka json array of experiments used as fallbacks
izanami.experiment.strategy.typeDevStrategy or FetchStrategy
izanami.proxy.feature.patternsPatterns used to expose the features through the proxy
izanami.proxy.config.patternsPatterns used to expose the configs through the proxy
izanami.proxy.experiment.patternsPatterns used to expose the experiments through the proxy

Spring starter minimum config

izanami:
host: http://localhost:8080
client-id: xxxx
client-secret: xxxx
feature:
strategy:
type: DevStrategy
config:
strategy:
type: DevStrategy
experiment:
strategy:
type: DevStrategy

Spring starter full configuration

izanami:
host: http://localhost:8080
client-id: xxxx
client-secret: xxxx
client-id-header-name: Izanami-Client
client-secret-header-name: Izanami-Secret
backend: SseBackend
page-size: 5
zone-id: America/Phoenix
dispatcher: izanami.blocking-dispatcher
feature:
strategy:
type: FetchWithCacheStrategy
error-strategy: RecoverWithFallback
duration: 2 minutes
max-element: 5
fallback: >
[
{ "id": "mytvshows:season:markaswatched", "enabled": false },
{ "id": "mytvshows:providers:tvdb", "enabled": true },
{ "id": "mytvshows:providers:betaserie", "enabled": false },
{ "id": "mytvshows:providers:omdb", "enabled": false }
]
autocreate: true
config:
fallback: >
[
{ "id": "izanami:example:config", "value": { "emailProvider": "test" } }
]
strategy:
type: CacheWithSseStrategy
error-strategy: Crash
polling-interval: 1 minute
patterns: [mytvshows:*, izanami:*]
autocreate: true
experiment:
fallback: >
[
{
"id": "mytvshows:gotoepisodes:button",
"name": "Test button",
"description": "Test button",
"enabled": true,
"variant": {
"id": "A",
"name": "Variant A",
"description": "Variant A"
}
}
]
strategy:
type: DevStrategy
proxy:
feature:
patterns: feature*
config:
patterns: config*
experiment:
patterns: experiment*

Spring beans

The beans exposed by this starter are

  • IzanamiClient : the root client
  • FeatureClient : the feature client if feature settings are defined
  • ConfigClient : the config client if feature settings are defined
  • ExperimentsClient : the experiment client if feature settings are defined
  • Proxy : the proxy used to expose the data via http

If the spring reactor is on the dependencies :

  • ReactiveConfigClient: The reactive version of the feature client if feature settings are defined

  • ReactiveExperimentClient: The reactive version of the config client if feature settings are defined

  • ReactiveFeatureClient: The reactive version of the experiment client if feature settings are defined