-
Notifications
You must be signed in to change notification settings - Fork 4
Configuration
Leon Rosenberg edited this page Oct 24, 2023
·
4 revisions
Following properties are supported by command line. System properties override file configuration.
Property | Meaning | Default |
---|---|---|
skipCentralRegistry | Don't use central registry, neither for registering, nor for lookup. Useful in p2p mode. | false |
localRmiRegistryPort | Port on which local rmi registry should run | - |
registryContainerHost | Host where central registry is running. This can also be configured via distributeme.json | - |
registryContainerPort | Port where central registry is running. This can also be configured via distributeme.json | 9229 |
localRmiRegistryMinPort | Starting range for local registry. | 9250 |
localRmiRegistryMaxPort | Finishing range for local registry. Each service needs one port, which means that the default allows only 49 services on one host | 9299 |
serviceBindingPort | Binding port for the service. If not specified 0 is used, which is interpreted as random. Useful for firewalls. | 0 |
It is possible to run distributeme with system properties only. However, if you run with configuration file (recommended) this is the minimal file you should have in your CLASSPATH. The name of the configuration file is distributeme.json
{
registryContainerHost: "127.0.0.1",
registryContainerPort: 9229,
}
But the configuration file can contain more options, here an example.
{
registryContainerPort: 9229,
registryContainerHost: "registry.system.prod",
//if true the server will log all exceptions including expected exception (defined by the interface), otherwise expected exceptions will be ignored
logServerSideExceptions: false,
//if true the client (stub) will log all caught exceptions (remote exception and runtime exceptions)
logClientSideExceptions: false,
//registrationIpMapping: "192.168.200.5:10.0.0.0",
"listener.1": "org.distributeme.core.listener.ServerLifecycleSysOutPrinterListener",
"interceptor.1": "org.distributeme.core.interceptor.availabilitytesting.ServiceUnavailableByPropertyInterceptor",
"interceptor.2": "org.distributeme.core.interceptor.availabilitytesting.ServerSideSlowDownByPropertyInterceptor",
"interceptor.3": "org.distributeme.core.interceptor.availabilitytesting.ServerSideSlowDownByConfigurationInterceptor",
test: {
bolbat: {
registryContainerPort: 8080,
registryContainerHost: "localhost",
},
interceptors: {
// "interceptor.1": "org.distributeme.test.interception.interceptor.LogOutBeforeCallInterceptor",
"interceptor.2": "org.distributeme.test.interception.interceptor.InterceptSumInterceptor",
"interceptor.3": "org.distributeme.test.interception.interceptor.ModifyReturnValueInterceptor",
"interceptor.4": "org.distributeme.test.interception.interceptor.InterceptInClientInterceptor",
"interceptor.5": "org.distributeme.test.interception.interceptor.InspectParameterExample",
"interceptor.6": "org.distributeme.test.interception.interceptor.PiggybackingInterceptor",
"interceptor.10": "org.distributeme.core.interceptor.moskito.MoskitoJourneyInterceptor",
// "interceptor.50": "org.distributeme.test.interception.interceptor.LogOutAfterCallInterceptor",
},
"flip": {
"interceptor.1": "org.distributeme.core.interceptor.availabilitytesting.FlippingServiceUnavailableByConfigurationInterceptor",
"interceptor.2": "org.distributeme.core.interceptor.availabilitytesting.FlippingServerSideSlowDownByConfigurationInterceptor",
"interceptor.3": "org.distributeme.core.interceptor.availabilitytesting.FlippingServerSideSlowDownByConfigurationInterceptor",
},
}
}
Multiple classes are using distributeme.json to configure themselves, please refer to the classes themselves for documentation for now:
- https://github.com/anotheria/distributeme/blob/master/distributeme-core/src/main/java/org/distributeme/core/RegistryLocation.java - on where to find the registry (in case of DistributeMe registry)
- https://github.com/anotheria/distributeme/blob/0078d5a3ae79b60f1f39862097fb310a9f021b54/distributeme-core/src/main/java/org/distributeme/core/Defaults.java#L81 - DefaultsConfiguration, standard behaviour.
- https://github.com/anotheria/distributeme/blob/0078d5a3ae79b60f1f39862097fb310a9f021b54/distributeme-core/src/main/java/org/distributeme/core/RegistryUtil.java#L30 - On how to connect to a registry.
- https://github.com/anotheria/distributeme/blob/0078d5a3ae79b60f1f39862097fb310a9f021b54/distributeme-core/src/main/java/org/distributeme/core/Verbosity.java#L13 - enables additional output on client/server side.
- https://github.com/anotheria/distributeme/blob/0078d5a3ae79b60f1f39862097fb310a9f021b54/distributeme-core/src/main/java/org/distributeme/core/interceptor/InterceptorRegistry.java#L26 - Configures interceptors.
- https://github.com/anotheria/distributeme/blob/0078d5a3ae79b60f1f39862097fb310a9f021b54/distributeme-core/src/main/java/org/distributeme/core/listener/ListenerRegistry.java#L24 - Configures listeners.