DIFFUSION_SERVER shared config

The diffusion adapter supports only one type of sharedConfig type - DIFFUSION_SERVER. It defines the details of the remote Diffusion server to connect to.

Once this shared config is defined, it can be referred to in any configuration of the services of the STREAM_TO_REMOTE service type or STREAM_FROM_REMOTE service type.

This means that any common Diffusion server configuration can be defined as a DIFFUSION_SERVER shared config and reused in multiple services.

Example 1. Sample configuration for sharedConfig of type DIFFUSION_SERVER
    {
      "sharedConfigName": "remoteDiffusionServer",
      "sharedConfigType": "DIFFUSION_SERVER",
      "description": "The Diffusion server connection detail of the remote server",
      "config": {
        "application": {
          "diffusion": {
            "url": "ws://localhost:7080",
            "principal": "admin",
            "password": "password",
            "reconnectIntervalMs": 5000
          }
        }
      }
    }

The supported application configuration parameters for this sharedConfig type are defined in the table below:

DIFFUSION_SERVER sharedConfig type
Key Description Default

url

The URL of the remote Diffusion server to connect to. When Diffusion is operating in a cluster, any cluster member can be connected to.

n/a

principal

The name of a principal defined within the Diffusion server with permission to manage topics.

n/a

password

The password required to connect with the specified principal.

n/a

reconnectIntervalMs

The interval (in milliseconds) at which the session must attempt to reconnect to the Diffusion server if a connection is lost.

5000

maximumMessageSize

The maximum size (in bytes) that any message (updated to or from Diffusion) can be. This may be used to limit the maximum size of data being passed.

The maximum size that can be held in a Java Integer.

maximumQueueSize

The maximum size of the outbound message queue for the connection. The outbound message queue must be large enough to accommodate all the update messages sent to the server. It may be necessary to increase this value for applications that send messages in bursts or continue to send messages when a session is disconnected and reconnecting. Larger values allow more messages to be queued, increasing the memory footprint of the session. If the outbound message queue fills, sending a message will cause the session to close with an error.

10000

inputBufferSize

The size of the TCP input buffer (in bytes) used by the connection to receive data from the server.

524288 (512 KiB)

outputBufferSize

The size of the TCP output buffer (in bytes) used by the connection for sending data to the server.

524288 (512 KiB)

additionalProperties

A map of user-defined properties to be passed to the server. This should only be used when the Diffusion server requires special properties to be applied when connecting. For details, refer to the Diffusion Client API documentation.

none

oauth

OAuth server details to use to fetch authentication token from an OAuth server. The OAuth token will be used to establish a session with the remote Diffusion server. If OAuth is configured, password should not be provided.

null

All configuration parameters for the DIFFUSION_SERVER sharedConfig type can also be defined within the configuration for STREAM_TO_REMOTE or STREAM_FROM_REMOTE services. The final configuration for such services will be a combination of the configuration defined for the service itself and the configuration of the sharedConfig referred to in the service configuration. If there is a duplicate configuration, the one in the service configuration will take precedence. This means that any configuration defined in the sharedConfig can be overridden by defining it in the service-specific configuration.

See Configuring the adapter for a complete example of the configuration for the adapter which specifies an instance of DIFFUSION_SERVER sharedConfig and refers to it in the service configurations.

OAUTH configuration
Key Description Default

server

OAuth server URL to fetch authentication token to use to connect to the remote Diffusion server.

n/a

headers

A key value pair of headers to use to send request to the OAuth server.

none

httpMethod

HTTP method to use to send request to the OAuth server. Accepted values are GET and POST

POST

payload

A key value pair of payload or request parameters to use when sending a request to the OAuth server.

none

Example 2. Sample configuration for sharedConfig of type DIFFUSION_SERVER with OAuth
    {
      "sharedConfigName": "remoteDiffusionServer",
      "sharedConfigType": "DIFFUSION_SERVER",
      "description": "The Diffusion server connection detail of the remote server",
      "config": {
        "application": {
          "diffusion": {
            "url": "ws://localhost:7080",
            "principal": "admin",
            "oauth": {
              "server": "https://localhost/oauth/token",
              "headers": {
                "Content-Type": "application/x-www-form-urlencoded",
                "Accept": "application/json"
              },
              "payload": {
                "client_id": "wfgrFfdsfsleialdasd",
                "client_secret": "THHHHldgjsOOJlg;OO",
                "grant_type": "client_credentials",
                "audience": "https://localhost:9090/v2"
              }
            }
          }
        }
      }
    }