Connectivity to Glue42 Enterprise

Overview

The Main app can be configured to constantly check for the presence of a locally installed Glue42 Enterprise. If such an instance is discovered, the Main app and all of its Web Client apps will attempt to switch their Glue42 connection to Glue42 Enterprise. If this operation is successful, the Glue42 Core+ environment will be able to fully interoperate with all Glue42 Enterprise clients.

This enables Glue42 Core+ projects to seamlessly integrate with Glue42 Enterprise without disrupting any of the running Web Client apps.

Behavior

As soon as the Main app discovers a running instance of Glue42 Enterprise and manages to connect to it, all current Web Client apps follow suit. The connection switch is executed without the apps reloading or flickering and is completely invisible to the end user. However, changing the connection of a Glue42 Core+ environment has numerous effects in all aspects of the Glue42 functionalities, explained in the following sections.

Shared Contexts & Channels

Switching between a Glue42 Core+ and a Glue42 Enterprise connection is handled seamlessly for the Shared Contexts library. If the Main app is configured to look for a Glue42 Enterprise connection, it will monitor all shared contexts and will be aware of their latest state. Once a connection switch happens, the Main app will be the last one to reconnect, ensuring that the latest state of all shared contexts is restored. All shared context subscriptions will be preserved and everything is executed without any visual interruption.

The Glue42 Channels are based on Shared Contexts. This provides full integration when connecting to Glue42 Enterprise. Both a Glue42 Core+ app and a Glue42 Enterprise app listening for changes to the same Glue42 Channel will be notified at the same time when the Channel data has been updated.

Interop

Upon a connection change, the Interop library will re-initiate and re-announce its current state. This means that all Glue42 Core+ clients, including the Main app, will preserve their respective peerId and instance ID. All registered Interop methods, streams and subscriptions will be preserved and carried over to the new connection.

Apps, Windows & Workspaces

The functionality of the App Management and Window Management libraries won't change in any way when a Glue42 Core+ environment connects to a Glue42 Enterprise instance. This means that the list() method of the Window Management API will always return a collection consisting only of the currently opened Glue42 Core+ windows, regardless of the connection state. The open() method of the Window Management API and the start() method of an app instance will always open a Glue42 Core+ window or start a Glue42 Core+ app respectively when called from a Glue42 Core+ app.

The same is applicable to the Workspaces library. Calling any of the Workspaces API methods from a Glue42 Core+ app will always open, fetch data or manipulate a Glue42 Core+ Workspace, regardless of whether or not the Glue42 Core+ environment is connected to Glue42 Enterprise.

Notifications

There aren't any changes in the operation of the Notifications library when connected to a Glue42 Enterprise instance. All raised notifications will be Glue42 Core+ notifications, meaning they will be raised by the browser. However, keep in mind that if you set an Interop method as a handler for a notification click or an action button of a Glue42 Core+ notification, this method may also have been registered by a Glue42 Enterprise app. Clicking on the notification or its action buttons will invoke all registered Interop methods with the same name, regardless of whether they have been registered by Glue42 Core+ or by Glue42 Enterprise apps. So, in a way, acting on a Glue42 Core+ notification can have effects in Glue42 Enterprise.

Rejected Connections

The following describes the cases when a connection attempt to Glue42 Enterprise may fail entirely or partially:

  • When the Main app has started a Glue42 Core+ app that uses an old version of the @glue42/web library. In this situation, the Web Client app won't be able to handle the connection switch instructions of the Main app. As a result, the Main app will either ignore this app and proceed with the connection switch or will cancel the connection switch attempt. This is determined by the forceIncompleteSwitch setting when configuring the connection settings in the Main app (see the Configuration section).

  • When the Main app is rejected by Glue42 Enterprise based on origin filtration or a custom authentication mechanism. In this situation, the Glue42 Core+ environment won't attempt to transfer the Web Client apps and will cancel the reconnection attempt. However, the cycle for discovering Glue42 Enterprise instances will continue, meaning that the Main app will periodically attempt a connection.

  • When the connection request of the Main app is accepted by Glue42 Enterprise, but the connection request of a Web Client app is rejected. This may happen due to origin filtration when the Main app and the Web Client app have different origins or as a result of some other custom Glue42 Enterprise authenticator. In this situation, the Main app will either ignore this app and proceed with the connection switch or will cancel the connection switch attempt. This is determined by the forceIncompleteSwitch setting when configuring the connection settings in the Main app (see the Configuration section).

Default Connection

If the Glue42 Enterprise instance to which the Glue42 Core+ environment is connected disappears, the Glue42 Core+ environment will resume its default state and all Web Client apps will fall back to the default Glue42 Core+ connection to their respective Main app.

Configuration

Enabling and configuring the discovery of Glue42 Enterprise is executed entirely in the Main app during the initialization of the @glue42/web-platform library. Use the connection property of the configuration object to specify settings for the connection to Glue42 Enterprise:

import GlueWebPlatform from "@glue42/web-platform";

const config = {
    connection: {
        preferred: {
            url: "ws://localhost:8385",
            auth:{
                username: "user",
                password: "password"
            },
            forceIncompleteSwitch: true,
            discoveryIntervalMS: 60000
        }
    }
};

const { glue } = await GlueWebPlatform(config);

The preferred property instructs the Main app that in addition to its own default connection, there is an additional one, whose availability is unknown, but is preferred if available. The preferred object has the following properties, of which only url is required:

Property Type Description
url string Required. A valid URL string pointing to the Glue42 Gateway to which to connect.
auth object Defines the authentication data that will be used when trying to connect to the Glue42 Enterprise instance. If this property isn't provided, Glue42 Core+ will attempt a connection with a dedicated Glue42 Core+ authenticator.
forceIncompleteSwitch boolean If true, the Main app will proceed and connect to Glue42 Enterprise when some or all of its clients have been rejected, due to using outdated @glue42/web packages or origin filtration. Default is false.
discoveryIntervalMS number The interval in milliseconds at which the Main app will try to find a local Glue42 Enterprise instance. Default is 15000.

Note that for a Glue42 Core+ environment to be able to discover and connect to a Glue42 Enterprise instance, the Glue42 Enterprise Gateway must use a known port whose URL you must supply to the url property of the preferred object. Currently, a Glue42 Core+ environment isn't able to discover a Glue42 Enterprise instance configured to use a dynamic port for the Glue42 Gateway.