Ok,
thats what I'm trying to do. It seems like I have everything setup
correctly but my messages never get to my queue that I added. Here is
the configuration code when ninject is setup:
protected override IKernel CreateKernel()
{
var massTransitModule = new MassTransitModule();
var buildModule = new BuildModule();
var kernel = new StandardKernel(massTransitModule, buildModule);
MsmqEndpointConfigurator.Defaults(config =>
{
config.CreateMissingQueues = true;
});
massTransitModule.AddTransport<MsmqEndpoint>();
massTransitModule.AddBus("nexus_builds", new Uri("msmq://localhost/
nexus_builds"));
return kernel;
}
Here is my service that is being called from a controller publishing
the message:
Guid buildId = Guid.NewGuid();
ServiceBus.Publish(new BuildRequestMessage(buildId));
And here is the code of the consumer of the message:
public class BuildAgentService : Consumes<BuildRequestMessage>.All,
IBuildAgent
{
public BuildAgentService(IServiceBus serviceBus)
{
ServiceBus = serviceBus;
}
protected IServiceBus ServiceBus { get; set; }
protected UnsubscribeAction UnsubscribeAction { get; set; }
public void Dispose()
{
ServiceBus.Dispose();
}
public void Consume(BuildRequestMessage message)
{
var buildResult = new BuildResult(true, "got it!!!");
var buildResponseMessage = new BuildResponseMessage
(message.CorrelationId, buildResult);
CurrentMessage.Respond(buildResponseMessage);
}
public void Start()
{
UnsubscribeAction = ServiceBus.Subscribe(this);
}
public void Stop()
{
UnsubscribeAction();
}
}
I start the MassTransit.RuntimeServices.exe and it seems to startup
fine exception it does give one exception:
An exception occurred receiving a message from 'msmq://lenovo-pc/
mt_subscriptions'
SQL Server Compact timed out waiting for a lock. The default lock time
is 2000ms
for devices and 5000ms for desktops. The default lock timeout can be
increased
in the connection string using the ssce: default lock timeout
property. [ Sessio
n id = 2,Thread id = 5992,Process id = 5892,Table name =
SubscriptionSaga,Confli
ct type = x lock (s blocks),Resource = RID: 1054:8 ]
And thats as far as I get. I can zip the code and e-mail it to you if
that would work better? Thank you for taking the time to try to help
me. I appreciate it.
Sean