LiveViewException: Invalid session error from long-distance connections

LiveViewException: Invalid session error from long-distance connections

book

Article ID: KB0076040

calendar_today

Updated On:

Products Versions
TIBCO Streaming 10
TIBCO Streaming 7

Description

We frequently see this error in the LiveView Server logs:
2019-03-05 09:06:16.702 WARN  LiveViewServerResource - publish-tuples: CapacityAggregation
com.streambase.liveview.client.LiveViewException: Invalid session '7c1b6f0d-bb0f-4d3d-8879-9331489933ff'
The StreamBase applications located in Asia and Europe that publish to the LiveView Server located in North America experience disconnects, while the application located in North America doesn't, even though it processes and publishes greater volumes of data.

Issue/Introduction

Consider locally hosting a LiveView server or using reliable transport.

Resolution

The StreamBase applications are using the LiveView Publish Output Adapter, which uses the 'lv://' wire protocol. Connections using this protocol establish a persistent websocket connection to the LiveView server. A websocket connection needs a stable internet connection without significant delays or dropped packets.

If the connection is interrupted while the websocket persistent connection is being established, then the "Invalid session" error will be logged in the LiveView server logs. The LiveView Publish Output Adapter will attempt to reconnect, but this would be reported by the LiveView server as a new connection with no relationship to any prior connection.

We recommend for Publisher applications that a reliable transport protocol be used instead of the "lv://" protocol. The main options are to use a message bus such as Kafka, TIBCO FTL, TIBCO EMS, or one of the JMS implementations, or use TIBCO Streaming Transactional Memory. To use the latter, create a LiveView server instance in the same geography as the clients and duplicate any data to be shared between remote LiveView servers into a StreamBase Query Table stored in Transactional Memory. Place the remote LiveView server instances in the same TIBCO Streaming cluster and the data will be shared using reliable transactions. One server may use the Query Table as a queue to read from, and the other as a queue to write to.

Do not use the StreamBase "sb://" wire protocol for this work, since it is designed for low latency and not reliable transport. It is best used between TIBCO Streaming servers on the same local intranet.

Note that Live Datamart versions prior to version 2.1.8 (StreamBase 7.6.8) would report frequent "Invalid session" errors due to product defect "SB-30498" which has been fixed in all later releases.