Anotheria
Documentation

Configuration

Runtime configuration for DistributeMe

System properties

Following properties are supported by command line. System properties override file configuration.

Don't use central registry, neither for registering, nor for lookup. Useful in p2p mode.

Port on which local rmi registry should run.

Host where central registry is running. This can also be configured via distributeme.json

Port where central registry is running. This can also be configured via distributeme.json

Starting range for local registry. Those are the ports local services will try to listen on. Except if serviceBindingPort is set.

Starting range for local registry. Those are the ports local services will try to listen on. Except if serviceBindingPort is set. Each service needs one port, which means that the default allows only 49 services on one host or all on one port.

Binding port for the service. If not specified 0 is used, which is interpreted as random. Useful for firewalls. This should be used if you need the server to be accessable under a specific port.

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 (Yes distributeme supports comments).

{
  "registryContainerHost": "registry.system.prod",
  "registryContainerPort": 9229,

  //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: