Instant module

iKnowBase comes with client and server side support for creating applications with real time asynchronous messaging support. The Instant server is implemented as a java module in the iknowbase-webapp application.

See the Development Guide#Using Instant for concept and examples.

Installation

The Instant Server is disabled by default, but can be enabled and configured using configuration properties.

Make sure that CORS is enabled in configuration id the clients use Instant on a different name or port than what is used for fetching content from iKnowBase Viewer.

Make sure you also configure the SecureTokenEngine InstallationGuide#SecureTokenEngine to enable web client single sign on between iKnowBase Viewer and Instant. An alternative without single sign on between iKnowBase Viewer and Instant is to use explicit login – see Authenticating with direct application container authentication .

Special requirements

The connected web-clients will be “always connected” using asycnchronous HTTP transport mechanisms and will, compared to traditional HTTP clients, need infrastructure with support for non-blocking I/O or a sufficient high number of supported concurrent connections. One Instant client subscription means one network connection. ikbInstant may be deployed on an application server separate from where the other iKnowBase applications are deployed, as long as it’s connected to the same iKnowBase database repository.

If Cross Origin Resource Sharing (CORS) is in use, the CORS address MUST use the same protocol as the webpage containing the JavaScript client. If the web page uses HTTPS, then the CORS address must also be HTTPS.

Configuring the Instant module

The Instant Server is disabled by default and must be explicitly enabled using configuration properties. The InstantServerConfiguration accepts these configuration properties:

Property name Description
com.iknowbase.instant.enabled Toggles whether the instant module is enabled.
com.iknowbase.instant.suspendTimeoutLP How long in miliseconds a Long Polling connection is suspended before the server resumes the connection. This will trigger a reconnect by the client.
com.iknowbase.instant.enableCORSFilter Server side support for Cross Origin Resource Sharing (CORS). The legal values are either “true” or “false”.
com.iknowbase.instant.cleanupTopicThreshold How often the disconnect cleanup maintenance thread looks for disconnected clients.
com.iknowbase.instant.cleanupDisconnectedConnectionsThreshold How long a connection needs to be in disconnect inactivity queue before it is examined and validated.
com.iknowbase.instant.broadcastDelayUserListUsers Delay between a client subscribe and the issued broadcast for userList is. Must be large enough to allow the client to complete the handshake and enter suspend mode.
com.iknowbase.instant.broadcastDelayUserListJoin Optional delay between a detected join and the issued broadcast. Default no delay.
com.iknowbase.instant.broadcastDelayServerRequest Optional delay between a serverRequest and the issued broadcast. Default no delay.

Note: Make sure you also configure SecureTokenEngine to enable authentication for web clients

InstantQueueServerConfiguration

The Instant Queue Server is the unit responsible for consuming messages published using Instant’s PL/SQL API and delivering them to the specified topic where all web clients are connected. This queue listener can of course be configured through The InstantQueueServerConfiguration which accepts these configuration properties:

Property name Description
com.iknowbase.instant.aq.enabled Toggles whether AQ messages is processed by this instance at all. The legal values are either “true” or “false”.
com.iknowbase.instant.aq.dequeTimeoutSeconds Number of seconds each dequeue() shall wait before recycyling.
com.iknowbase.instant.aq.spawnPolicy Decides when the AQ server starts listening for a new message. Use “immediate” for parallel processing, or “delayed” for serial processing.

Testing and troubleshooting

For developers, the Administration Console provides monitoring and testing details for Instant.