Hi,
So I have 2 pipelines, one that checks if the message is supposed to go in a “company stream” (stream related to a specific client) and one that checks if the message is supposed to go in “system logs”. The criteria is simple: if the message has a stream_id field, it is routed to the company stream with id stream_id. If there is no stream_id field, message goes into system_logs.
My first pipeline, “handle_company_logs” has only one stage and one rule:
rule "route_to_company_stream"
when
has_field("stream_id")
then
route_to_stream(id: to_string($message.stream_id), remove_from_default: true);
end
This one works without any problem
My second pipeline, “handle_system_logs” also only have one stage and one rule:
rule "route_to_system_stream"
when
NOT has_field("stream_id")
then
route_to_stream(name: "system_logs", remove_from_default: true);
end
And this one does not work. I know it still goes through this pipeline because if I add set_field("WHAT_THE_HELL",666); in the then clause before route_to_stream, my messages without the field stream_id have a new WHAT_THE_HELL field to value 666, but they still end up in the All messages stream.
I also tried routing using the stream id with:
route_to_stream(id: "5cdfe3d8ef7fba001faa83ba", remove_from_default: true);
which is the id of the stream system_logs but it didn’t change anything.