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

Administration console

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

Session cookie collision when Instant is deployed to a separate instance with CORS

You may encounter a session cookie collision if you

As the host name is the same for both requests, the session cookie name will by default be valid for both requests. The session cookie is only valid on one server, which will result in a replaced session cookie and effective log out the authenticated user.

Resolve the issue by changing the session cookie name for one of the applications or use different hostnames for accessing the applications.

WebLogic: WARN AtmosphereFrameworkInitializer – WebLogic 12c unable to retrieve Servlet. Please make sure your servlet-name is ‘AtmosphereServlet’ or set org.atmosphere.servlet to the current value

This warning can safely be ignored.

WebLogic: Log messages related to BlockingIO

The current Atmosphere library incorrectly switches to BlockingIO if JSR356AsyncSupport is not available.

ERROR   DefaultAsyncSupportResolver - Failed to create comet support class: class org.atmosphere.container.JSR356AsyncSupport, error: java.lang.reflect.InvocationTargetException
ERROR   DefaultAsyncSupportResolver - Switching to BlockingIO

This has been registered as Atmosphere Issue 2018 and fixed for future versions. iKnowBase 7.0 ships with a workaround to avoid BlockingIO and you should see the previous ERROR messages immediately followed by:

WARN    IKBAsyncSupportResolver - Atmosphere issue 2018 detected. Overriding asyncSupport class from BlockingIOCometSupport to Servlet30CometSupport to avoid Blocking IO