I am trying to learn how to use Mass Transit found here.
I have made a project with two consoles and can get them talk to each other. Essentially I just followed the samples that came with it and kind of learnt that way.
I am now trying to get Mass Transit work with a web application. I made a new web app in VS2010 with the sample project stuff and just added a button to the page. The idea is when you click the button it adds a message to the queue and I was just going to have the sample app for Starbucks (the one that comes with Mass transit), it read the message from the queue (the Cashier or Barista console). So essentially, I am trying to make the Starbucks 'customer' program into a web interface.
The problem:
I read the docs and it appears I have to initialize the service bus in the global app on Application_Start. I do this and then call it on the button. I just use:
sbc.UseMsmq();
sbc.ReceiveFrom("msmq://localhost/test_queue");
sbc.UseControlBus();
in the initialize.
The button I just have:
var message = new NewOrderMessage
{
CorrelationId = _transactionId,
Item = "1",
Name = "1",
Size = "1",
};
bus.Publish(message);
I have also tried:
Bus.Instance.Publish(message, x => x.SetResponseAddress(Bus.Instance.Endpoint.Address.Uri));
and a whole bunch of other stuff.
It throws an error but in:
ServiceBusConfiguratorImpl.cs
the line that says:
builder = configurator.Configure(builder);
The error being:
Could not load file or assembly 'Stact, Version=1.1.0.0, Culture=neutral, PublicKeyToken=b800c4cfcdeea87b' or one of its dependencies. The system cannot find the file specified
So I am a bit lost...
Like I said, all I really want to do is change the 'customer' program from the Starbucks sample to a web interface so I can learn how to use mass transit for a web app.
If anyone has a working sample or a tutorial on how to get this running it would be greatly appreciated. I have searched on google for a couple of hours but have not found anything helpful.... :S
Thanks in advance,
Kindest Regards, Robin
.net, mass transit, MSMQ, C#, service bus