How to run multiple StreamBase v10 engine processes that exchange tuples

How to run multiple StreamBase v10 engine processes that exchange tuples

book

Article ID: KB0082963

calendar_today

Updated On:

Products Versions
TIBCO Streaming 10.x

Description

In some cases, you might want to run separate StreamBase applications, each being run in its own independent process, but still have the ability to exchange tuples.  

Issue/Introduction

How to run multiple StreamBase v10 engine process that talk to each other and exchange tuples via container connections.

Resolution

You must use different StreamBase Engine HOCON configuration files for each application you wish to be run in its own process.  This means each application is placed in its own unique EvenFlow Fragment project.  These projects are then used as dependencies for the main Deployment Application project.  

Each EventFlow Fragment project contains two primary configuration files:
  1. A StreamBase Client API Listener file to specify different tcp ports for each application
  2. A StreamBase Engine file to specify container names and container connections to link the streams that exchange tuples.
A set of example projects is attached, and can be run using the following commands:
  1. epadmin install node application=../deployApp-0.0.1-SNAPSHOT-ep-application.zip nodename=A.sb10
  2. epadmin servicename=A.sb10 start node
  3. epadmin servicename=A.sb10 display container
    [A.sb10] Engine = default-engine-for-com.example.upstream
    [A.sb10] Path = upstream
    [A.sb10] Type = NORMAL
    [A.sb10] Enqueue = ENABLED
    [A.sb10] Dequeue = ENABLED
    [A.sb10] State = RUNNING
    [A.sb10] Input Streams = InputStream
    [A.sb10] Output Streams = OutputStream
    [A.sb10] Modules = 
     
    [A.sb10] Engine = default-engine-for-com.example.downstream
    [A.sb10] Path = downstream
    [A.sb10] Type = NORMAL
    [A.sb10] Enqueue = ENABLED
    [A.sb10] Dequeue = ENABLED
    [A.sb10] State = INITIALIZED  // N.B. container started suspended
    [A.sb10] Input Streams = InputStream
    [A.sb10] Output Streams = OutputStream
    [A.sb10] Modules = 
  4.  epadmin servicename=A.sb10 resume container name=downstream
    [A.sb10] Engine = default-engine-for-com.example.upstream
    [A.sb10] Path = upstream
    [A.sb10] Type = NORMAL
    [A.sb10] Enqueue = ENABLED
    [A.sb10] Dequeue = ENABLED
    [A.sb10] State = RUNNING
    [A.sb10] Input Streams = InputStream
    [A.sb10] Output Streams = OutputStream
    [A.sb10] Modules = 
     
    [A.sb10] Engine = default-engine-for-com.example.downstream
    [A.sb10] Path = downstream
    [A.sb10] Type = NORMAL
    [A.sb10] Enqueue = ENABLED
    [A.sb10] Dequeue = ENABLED
    [A.sb10] State = RUNNING // N.B. - container has been started
    [A.sb10] Input Streams = InputStream
    [A.sb10] Output Streams = OutputStream
    [A.sb10] Modules = 
     
    [A.sb10] Engine = default-engine-for-com.example.downstream
    [A.sb10] Path = RC_0_downstream_InputStream
    [A.sb10] Type = NORMAL
    [A.sb10] Enqueue = ENABLED
    [A.sb10] Dequeue = ENABLED
    [A.sb10] State = RUNNING
    [A.sb10] Input Streams = 
    [A.sb10] Output Streams = out
    [A.sb10] Modules = 
  5. epadmin servicename=A.sb10 display connection
    [A.sb10] Engine = default-engine-for-com.example.upstream
    [A.sb10] id = DB061451886ACA73812BB994A64E4D96
    [A.sb10] peer = /127.0.0.1:65171
    [A.sb10] local = /127.0.0.1:10001
    [A.sb10] memory = 0bytes
    [A.sb10] subscriptions = system._internal_control,upstream.OutputStream
    [A.sb10] dequeued = 1
    [A.sb10] enqueued = 0
    [A.sb10] dequeuePackets = 1
    [A.sb10] enqueuePackets = 0
    [A.sb10] enqueuedStreams = 
    [A.sb10] enqueueBufferSize = 
    [A.sb10] protocolFamily = 10.3
    [A.sb10] status = OK/OK

Attachments

How to run multiple StreamBase v10 engine processes that exchange tuples get_app