How to identify the StreamBase API client which disconnected

How to identify the StreamBase API client which disconnected

book

Article ID: KB0074250

calendar_today

Updated On:

Products Versions
TIBCO Streaming 10

Description

Can the Excel Add-In StreamBase client-id be tracked down to match a client which is disconnecting after running for awhile?

Issue/Introduction

Troubleshooting command usage

Resolution

StreamBase Excel Add-In clients are normal StreamBase API clients and may be identified the same way. A StreamBase API client has two queues associated with it, a local queue and a server queue. The local queue may store up to 10,000 tuples. When the local queue is exhausted, the server starts queuing up to a configured limit. When both queue limits are reached because the client does not empty its queue as fast as the server is publishing new data, the server will disconnect the client. The disconnection is reported in the server log like this:
2020-12-17 09:00:38.201-0300 [Thread- ThreadPool - 138] INFO  com.streambase.sb.sbd.TupleQueue - Disconnecting client 8C3D8DA4376CC78AC33D10EB1A82D7A8

The client ID's can be matched to queue growth and disconnect errors only by pro-actively running 'sbadmin listConnections --current' on the StreamBase Server at intervals and keeping a log. Or run the 'sbadmin listConnections --old' shortly after a disconnection is reported in the server console log to get the ID.

The client id's are reported in the 'sbadmin listConnections' output, as so:
id=8C3D8DA4376CC78AC33D10EB1A82D7A8; peer=/127.0.0.1:56445; local=/127.0.0.1:10000; memory=0bytes; subscriptions=default.TicksOut,system._internal_control; dequeued=549; enqueued=0; dequeuePackets=549; enqueuePackets=0; protocolFamily=7.7; status=OK/OK

And the same client ID is reported in the console log later when an error occurs, as so:
2020-12-17 09:00:38.201-0300 [Thread- ThreadPool - 138] INFO  com.streambase.sb.sbd.TupleQueue - Disconnecting client 8C3D8DA4376CC78AC33D10EB1A82D7A8

Equivalent output for the 'sbadmin listConnections --all' option is available for Streaming 10.x and later versions, for example:
$ epadmin servicename=A.X serviceprefix=false delimiter=, display connection type=client
Engine,id,peer,local,memory,subscriptions,dequeued,enqueued,dequeuePackets,enqueuePackets,enqueuedStreams,enqueueBufferSize,protocolFamily,status,
com_example_financial_marketFeedMonitor_MarketFeedMonitor0,DA8915BF567938F5626A1E46FD29025C,/10.95.1.143:57701,/10.95.1.143:30591,,,0,338,0,338,default.TicksIn,768bytes,10.6,OK/OK,
com_example_financial_marketFeedMonitor_MarketFeedMonitor0,3AE73CD1B18D9D0F132692E7B9ED4199,/10.95.1.143:57632,/10.95.1.143:30591,0bytes,default.TickFallOffAlert,default.TickStats,default.TicksOut,system._internal_control,system.error,2141,0,1746,0,,,10.6,OK/OK,

In the 'listConnections' output, identify the type of client by its subscriptions. For example, the above client is only subscribed to: default.TicksOut,system._internal_control. This matches Excel Add-In function:
  =SBGetField("DefaultServer","TicksOut","Symbol",ROW() - 2,"Symbol='IBM'",TRUE)
which is using server-side evaluation to apply a filter to limit the data sent to the client.

Also, look at the 'listConnections' output for "memory=NNNNbytes". If there is no queuing for this client, the value is "0bytes". If there is queuing at the time of the report, this will be larger. Taking a regular log can show trending for a given client.

If the server is still running and you see an error for a disconnected client, you can run:
  sbadmin listConnections --old
to report on historical closed connections for this server session, but the data is not preserved forever, so run this command within 30 minutes of the error.

The Excel RTD connection will have at least two clients to support the Plug-In panel, and then additional clients for each set of functions that cannot be combined because:
a) they dequeue from a different set of streams,
b) they have incompatible server-side filter expressions.