Question Matthew Martinez · 3 hr ago

Checking for a value within a stream in the condition of a routing rule

Hello all,

I have a EnsLib.HTTP.GenericMessage inbound from a webhook with a GC stream.

example of stream contents

My router is defined as the following:

General Message Routing Rule

The msgClass for said rule is: EnsLib.HTTP.GenericMessage

I have tried a few variants of using a Contains in the condition to check the following: Document.StreamGC.Attributes.

I want to check the Stream for "HITL".  If it contains that, we send downstream.

Is there a way to do this within the condition in the rule?

Is the best solution to instead write a function that rewinds the stream and returns a flag?

Thank you!

Product version: IRIS 2022.1

Comments

Stephen Canzano · 2 hr ago

In the rule you should be able to have an expression with 

Stream.Read(some number of character.. you might consider 3200000)  

to get the first X characters of the stream content... of course assuming the thing you are searching for can be found in that string.

0
Matthew Martinez  1 hr ago to Stephen Canzano

The streams we are processing are fairly short.  I will give this a shot.

0
Matthew Martinez  1 hr ago to Stephen Canzano

Any suggestion on syntax?  I cannot get it to resolve in the rule editor:

 

 

Does not play nice.

Thank you

0