Striim 4.0.4 documentation

CREATE ROUTER

CREATE ROUTER <name> INPUT FROM <stream name> [ AS <alias> ]
CASE
  WHEN <expression> THEN ROUTE TO <stream name>,...
[ ELSE ROUTE TO <stream name> ] 
;

Distributes events from an input stream among two or more output streams based on user-defined criteria.

  • If an event matches more than one WHEN expression, a copy will be output to each of the corresponding streams.

  • If an event matches none of the WHEN expressions, it will be output to the ELSE stream.

  • If no ELSE clause is specified, events that do not match any of the WHEN expressions are discarded.

See CREATE CQ (query), Operators, and Functions for information about writing expressions.CREATE CQ (query)

Note

In this release, routers can not be created or edited in Flow Designer.

For example:

CREATE ROUTER myRouter INPUT FROM mySourceStream AS src 
CASE
  WHEN TO_INT(src.data[1]) < 150 THEN ROUTE TO stream_one,
  WHEN TO_INT(src.data[1]) >= 150 THEN ROUTE TO stream_two,
  WHEN meta(src,"TableName").toString() like 'QATEST.TABLE_%' THEN ROUTE TO stream_three,
ELSE ROUTE TO stream_else;