Soabase's various features are controlled in the standard Dropwizard way: via configuration. Your application's configuration object must have Soabase configuration fields. Soabase uses its Configuration Utility to find the configuration objects. The only required configuration is SoaConfiguration.
SoaConfiguration is the main configuration object.
Field | Description | Default |
discovery | Defines the Service Discovery implementation to use. The default is a NOP instance. To use the provided Curator implementation, set the type to "zookeeper". See Service Discovery for details. | NOP |
attributes | Defines the Dynamic Attributes implementation to use. The default is a simple in-memory implementation. To use the provided JDBC implementation, set the type to "sql". See Dynamic Attributes for details. | in-memory only |
checkPeriodMs | How often to poll Dropwizard's health checks and update the instance state in Service Discovery. | 10 seconds |
shutdownWaitMaxMs | How long to wait when shutting down the application | 1 minute |
serviceName | The service that this instance is part of. A dynamic attribute scope will be defined with this name. | none - must be provided |
instanceName | The name for this instance. A dynamic attribute scope will be defined with this name. | InetAddress.getLocalHost().getHostName() |
additionalScopes | Any additional scopes you want to define. | n/a |
addCorsFilter | If true, add the Dropwizard CORS filter. | true |
discoveryHealth | The Discovery Health integration to use. The default marks the instances as healthy in Service Discovery only when all Dropwizard health checks return healthy. | DefaultDiscoveryHealth |
adminJerseyPath | Enables Jersey Resources for the Dropwizard Admin servlet. This is the URL path to use. If null, Jersey Resources are not enabled for the Admin servlet. | /api |
registerInDiscovery | If true, registers the instance in Service Discovery. If false, does not. | true |
deploymentGroups | The deployment groups that this instance is part of (if any). See Deployment Groups for details. | n/a |
The Service Discovery implementation is specified by the "discovery" field. To use the default Curator implementation specify the config as "zookeeper". E.g. assuming your SoaConfiguration field is named "soa":
{ ... "soa": { "discovery": { "type": "zookeeper" .... } } }
Your configuration class must have a field of type CuratorConfiguration. It defines these configuration values:
Field | Description | Default |
name | Allows for multiple Curator connections | "Default" |
connectionString | The ZooKeeper connection string | none - required |
The Dynamic Attributes implementation is specified by the "attributes" field. To use the default JDBC implementation specify the config as "sql". To Use the JDBI implementation specify the config as "jdbi". E.g. assuming your SoaConfiguration field is named "soa":
{ ... "soa": { "attributes": { "type": "sql" .... } } }
If using MyBatis, your configuration class must have a field of type SqlConfiguration. It defines these configuration values:
Field | Description | Default |
name | Allows for multiple SQL connections | "Default" |
mybatisConfigUrl | The Soabase JDBC implementation uses Mybatis. This is the URL for the Mybatis configuration file. | none - required |
Additionally, you can specify options for the SqlDynamicAttributesFactory in the attributes section of your configuration:
Field | Description | Default |
name | The SoaFeatures name that your MyBatis session is registered as. | "Default" |
refreshPeriodSeconds | The number of seconds between polls of the database for changes. | 30 |
If using JDBI, you can specify options for the JdbiDynamicAttributesFactory in the attributes section of your configuration:
Field | Description | Default |
name | The SoaFeatures name that your DBI instance is registered as. | "Default" |
refreshPeriodSeconds | The number of seconds between polls of the database for changes. | 30 |