I'm learning MassTransit's StateMachine, it's helpful in my usecase, really like it, now I would like to learn more about how to use Activity properly but it's hard to find document/examples, please help me with some questions:
What do
ProbeandAcceptmethods do? For example:public void Probe(ProbeContext context) { context.CreateScope("foo"); } public void Accept(StateMachineVisitor visitor) { visitor.Visit(this); }
What are Scope and Visitor?
I chain 2 Activities like this
.Activity(x=>x.OfType<FirstActivity>()).Activity(x=>x.OfType<SecondActivity>())
In FirstActivity.Execute method, it throws Exception but SecondActivity.Faulted never hit, how to set them up correctly?
Thank you.
There are many activities in this project you can use to see how they're created.
And if your first activity throws an exception, the next activity and any other subsequent activities won't be called because an exception was thrown and not handled. You can use a
.Catchstate machine expression to configure exception handlers.