WebSocket Emulation mechanism in TIBCO Web Messaging for TIBCO EMS (TWM).

WebSocket Emulation mechanism in TIBCO Web Messaging for TIBCO EMS (TWM).

book

Article ID: KB0091183

calendar_today

Updated On:

Products Versions
TIBCO Web Messaging for TIBCO Enterprise Message Service -
Not Applicable -

Description

Resolution:
Description:
============
WebSocket Emulation mechanism in TIBCO Web Messaging for TIBCO EMS (TWM).

Environment:
===========
All versions of TIBCO Web Messaging for TIBCO EMS


Resolution:
==========

Native WebSocket is not widely support in many mainstream programming languages or browser clients. For those clients, TWM use two HTTP request channel for emulating WebSocket-like duplex communication.

Those two HTTP request channel are described as "upstream" and "downstream":

Upstream is the channel in which TWM client will send HTTP request to server. Typical it will be used when clients request connecting to the TWM server, client subscribe/un-subscribe to a destination and client close the connection

Downstream is the channel that TWM uses to push data to the client. Due to the nature of the HTTP protocol, it is impossible for the server to actively push data to a client. In this case, TWM maintains a long-live HTTP connection and sends HTTP 1.0 responses without a content-length header. To "push" data to a client, the TWM server adds the data to the response body within the same HTTP connection. The client shall expect more data coming from the server side since it does not have the information of the content-length.


1). Initial Request

POST /;post/jms/;e/cb HTTP/1.1

TWM return two URLs which are called the "upstream" resource and the "downstream" resource.

http://liyan-z210:8001/jms/;e/ub/O9l7Z0DrXNYdoVzCcO43QVwoWNFrhV8v
http://liyan-z210:8001/jms/;e/db/O9l7Z0DrXNYdoVzCcO43QVwoWNFrhV8v

The token of "e/ub" indicates this is for upstream and "e/db" is for downstream.

2). The client will now send a request to the two URLS to collaborate with the TWM server.

#. POST /;post/jms/;e/ub/O9l7Z0DrXNYdoVzCcO43QVwoWNFrhV8v HTTP/1.1

#. POST /;post/jms/;e/ub/O9l7Z0DrXNYdoVzCcO43QVwoWNFrhV8v HTTP/1.1

Issue/Introduction

WebSocket Emulation mechanism in TIBCO Web Messaging for TIBCO EMS (TWM).