CurlyFro
CurlyFro

Reputation: 1882

Can i call a dynamic saga by name?

I have a list of products uniquely identified by name. each product has it's own ordering process. I'd like each products ordering process to be defined by a saga. is there a way for me to process each product using a different saga? Can i use endpoints for this? Would bus.Send(product name, message) work?

I hope this makes sense.

Upvotes: 0

Views: 259

Answers (2)

Udi Dahan
Udi Dahan

Reputation: 12057

You can do some custom saga finding logic (as described here) to control this. For a more complete example, check out this blog post which shows how to do that based on headers.

Upvotes: 1

Tyler Day
Tyler Day

Reputation: 1718

The short answer is no you can't call a saga by name. However, you can easily do this with standard messaging. You would just create a new more specific message which inherits from your product message base class. Then have your product specific saga be started by that message type.

Upvotes: 1

Related Questions