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.
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!
Comments
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.
The streams we are processing are fairly short. I will give this a shot.
Any suggestion on syntax? I cannot get it to resolve in the rule editor:
Does not play nice.
Thank you