I am going through the samples and reading the docs but I am still not sure of how to configure rebus for my scenario (or that using the bus is a good fit).
I have one producer of Tasks to do, lets say ImportOrder and CalculateOrderPrice
I want to dump messages from the producer and queue lots of these messages. I want two clients that listens to ImportOrder, and 10 clients that listens to CalculatePriceOfOrder. I do not want the same order to go to multiple endpoints at the same time, I am trying to spread the workload.
Producer config so far:
<rebus inputQueue="publisher.input" errorQueue="publisher.error" workers="1" maxRetries="5">
var adapter = new BuiltinContainerAdapter();
Configure.With(adapter)
.Logging(l => l.Log4Net())
.Transport(t => t.UseMsmqAndGetInputQueueNameFromAppConfig())
.Subscriptions(s => s.StoreInXmlFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "rebus_subscriptions.xml")))
.MessageOwnership(d => d.FromRebusConfigurationSection())
.CreateBus()
.Start();
Consumer config so far:
<rebus inputQueue="calcserver1.input" errorQueue="calcserver1.error" workers="1" maxRetries="5">
<endpoints>
<add messages="Messages.RecalculateContractMessage, Messages" endpoint="[email protected]"/>
</endpoints>
Configure.With(adapter)
.Logging(l => l.Log4Net())
.Transport(t => t.UseMsmqAndGetInputQueueNameFromAppConfig())
.MessageOwnership(d => d.FromRebusConfigurationSection())
.CreateBus()
.Start();
adapter.Bus.Subscribe<RecalculateContractMessage>();
I cant seem to configure this setup, it does not really matter if I use msmq or sqlserver.
- Does rebus (or any servicebus type of solution) sound like a good fit here?
- Should I use pub/sub or plain Send pattern? And will that choice affect if messages gets processed by only one endpoint at the time or several?
- Could anyone point me to a good example or explain how to set this scenario up?