LiveView Web Services-only Front-end

LiveView Web Services-only Front-end

book

Article ID: KB0071721

calendar_today

Updated On:

Products Versions
TIBCO LiveView Web 1.4.1 and prior

Description

The purpose of running a LiveView Web instance separately from a production LiveView Server is to allow each to run on a separate system for load balancing, federation and structural isolation of user communities.

Resolution

Note: This configuration applies to the TIBCO Live Datamart product and LiveView instances run in the TIBCO StreamBase product versions 7.7 and prior. If a similar configuration is needed in TIBCO Streaming 10.x and later, please contact Technical Support.

Deployment Architecture:

LiveView Services Only (hosting LV Web only) → LiveView Server Back-End (tables and EventFlow, no web applications)

LiveView Web must be run in a LiveView server instance, whether in a full LV server or in a services-only configuration. It cannot be run in a web-application server (Apache, JBOSS). This is necessary because LV Web makes use of the LiveView server’s hosted H2 database (found in directory “lv-systemdata”) which is not available through the public LiveView JavaScript API. LV JS API applications that do not use the H2 database may be hosted on a separate web-application server.

Example:

This example modifies the “sample_lv-web” project which comes with the LiveView Web install.

Load the “sample_lv-web” project from the LiveView Web install directory two times into the StreamBase Studio workspace, renaming them as follows using the Refactor > Rename menu:

1). Rename the first with the name “sample_lv-web_services-only”.
2). Rename the other as “sample_lv-web_backend”.

The LV Web sample application has authentication turned ON by default and authentication must be enabled in the LV services-only instance for LV Web to correctly manage user access controls and per-user configurations. For this example, the back-end project has authentication turned OFF since it will only be accessed from the services-only instance.

In the services-only project, remove the table and application implementation artifacts (.lvconf, .sbapp, and related files) but keep the authentication configuration. Add a RemoteLiveview.lconf with configuration:
 
<?xml version="1.0" encoding="UTF-8"?>
<liveview-configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.streambase.com/schemas/lvconf/">
    <external-server-connection id="RemoteLiveview" type="LiveView">
        <parameters>
            <parameter key="uri">lv://localhost:10081/</parameter>
        </parameters>
        <mappings>
            <mapping selector="" formatter=""/>
            <mapping selector="(.*)" formatter="%s"/>
        </mappings>
        <retry-parameters/>
    </external-server-connection>
</liveview-configuration>


Remove other .lvconf, .sbfs, sbint, sbapp, sblayout files. The project should contain only the folders and artifacts:

JRE System Library
java-src/
lv-profile/
lv-systemdata/
lv-user-webapps/ (lvweb.war)
lv-web/
src/
liveview.auth.properties
liveview.properties
RemoteLiveview.lvconf
sbd.sbconf

Note: Remove from sbd.sbconf the unneeded setting:
    <sysproperty name="liveview.enable.jdbc" value="true"/>

...which will be removed in a future release.

In the back-end project, remove the web applications and authentication but keep the table and application implementation artifacts.

Remove:
liveview.auth.properties/
liveview.properties/
lv-user-webapps/
lv-web/

The sbd.sbconf file should contain only:
 
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<streambase-configuration xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.streambase.com/schemas/sbconf/">
    <global>
        <module-search directory="lv-interfaces"/>
        <module-search directory="ItemsSalesDataSource"/>
    </global>
    <server>
        <param name="tcp-port" value="10001"/>
    </server>
    <java-vm>
        <sysproperty name="liveview.port" value="10081"/>
    </java-vm>
</streambase-configuration>
 

To Run:


1). Open a StreamBase CMD Prompt with “sample_lv-web_backend” as the current directory. Run:
lv-server run .

2). Open a StreamBase CMD Prompt with “sample_lv-web_services-only” as the current directory. Run:
lv-server run --services .

3). Open a web browser to:
http://localhost:10080/lvweb

The LV Web application receives alerts from both the front-end and back-end servers but only configures alerts on the front-end server. The front-end or services-only server will receive a conflated flow of updates from the back-end server. It will not see every row update. Front-end-defined alerts may miss some triggering events which would cause an alert if the alert were instead executed in the back-end.

To shut down each server, run:
lv-client -u lv://admin:admin@localhost:10080 shutdown
lv-client -u lv://localhost:10081 shutdown

Issue/Introduction

How to run LiveView Web separately from the production LiveView Server.