Diffusion server session management

Remote Diffusion server session

Apart from the LOCAL_TO_LOCAL service type, other service types require a session to the remote Diffusion server.

When multiple services are added to the application, if they use the same Diffusion connection parameters, a single session is established to the remote server which is shared across different services. However, if the services use different connection parameters to connect to the remote Diffusion server, specific sessions will be established.

As soon as a service is added and started successfully, a session to the remote server will be established. Services added afterwards with the same connection parameters will reuse the created session. The session will be maintained as long as at least one service using the session is available. As soon as all the services are removed, the created session will be closed.

In case of any transient or non-transient network errors, the application will attempt reconnection in the specified reconnection interval until the connection is established.

When the connection to the remote server is disconnected, services connected to that remote server will be paused, and any topic subscriptions on the local server will be unsubscribed from. When the session re-establishes, the services will resume and start operating normally.

Local Diffusion server session

Since the Diffusion adapter is an application created using the Gateway Framework, the connection with the local Diffusion server is managed by the Gateway framework. The framework creates a single Diffusion session which is used by all services in the application.

Similar to the remote server, when the session is disconnected from the local server, the framework will attempt reconnection in the specified reconnection interval.

When the session with the local server is disconnected, the services will be paused, and any topic subscriptions on the remote server will be closed.