Skip to content
Leon Rosenberg edited this page Oct 24, 2023 · 4 revisions

Configuration

System properties

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

Configuration file

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:

Clone this wiki locally