Filtering messages prior to hitting a state machine

586 views
Skip to first unread message

Kenneth Avner

unread,
Oct 22, 2016, 8:42:54 AM10/22/16
to masstransit-discuss
Hi,

I would very much appreciate your help. I have a system that uses a few different kinds of Autom. state machines.
To put a long story short; I need to put a filter in before a message is routed into the Saga. The filter is to effectively cancel processing of the given message long before it hits the Saga and a lookup is made in the Saga repository etc. I plan to do this filtering based on headers.

The thing is that there are several state machines, with different logic ofcourse, that load the same instance type. These state machines sends commands and then listen on published events. The published events are the problem, and I wish to filter them based on headers before they hit the sagas. The filtering is not to be done on message fields.

I have looked into the pipeline specifications but cannot find which premade types to use, or what interfaces to use for implementing my own filtering block in the pipeline. Anyone?

Chris Patterson

unread,
Oct 22, 2016, 11:05:15 AM10/22/16
to masstrans...@googlegroups.com
There is a ContextFilter in the next release (it's easy to replicate in the meantime) which allows you to filter messages along the pipeline. You could use it as an example until the next release is available.



--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.
To post to this group, send email to masstransit-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/41b59798-7c94-4407-9465-2bec21f054ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kenneth Avner

unread,
Oct 23, 2016, 8:58:32 AM10/23/16
to masstransit-discuss
Awesome. I first tried using the old generic message-specific version, which did not work out. After looking at the new generic context-specific filter, I quickly made it all work. Nice!
Thank you very much.

-K

lørdag 22. oktober 2016 17.05.15 UTC+2 skrev Chris Patterson følgende:
There is a ContextFilter in the next release (it's easy to replicate in the meantime) which allows you to filter messages along the pipeline. You could use it as an example until the next release is available.


On Sat, Oct 22, 2016 at 5:42 AM, Kenneth Avner <ken...@avner.no> wrote:
Hi,

I would very much appreciate your help. I have a system that uses a few different kinds of Autom. state machines.
To put a long story short; I need to put a filter in before a message is routed into the Saga. The filter is to effectively cancel processing of the given message long before it hits the Saga and a lookup is made in the Saga repository etc. I plan to do this filtering based on headers.

The thing is that there are several state machines, with different logic ofcourse, that load the same instance type. These state machines sends commands and then listen on published events. The published events are the problem, and I wish to filter them based on headers before they hit the sagas. The filtering is not to be done on message fields.

I have looked into the pipeline specifications but cannot find which premade types to use, or what interfaces to use for implementing my own filtering block in the pipeline. Anyone?

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.
To post to this group, send email to masstrans...@googlegroups.com.

Dileepkumar K

unread,
Mar 24, 2017, 11:12:52 AM3/24/17
to masstransit-discuss
Kenneth,

Is it possible for you to share an example on how to achieve this?

Thanks in advance.

-D
Reply all
Reply to author
Forward
0 new messages