I have an MVC3 app that sends commands (messages) to a console app server.
There server is setup as such:
private static void Main(string[] args)
{
var host = new RemoteAppDomainHost(typeof (BootStrap));
host.Start();
Console.WriteLine("Starting to process messages");
Console.ReadLine();
}
When a message is consumed, I am also publishing a new event message:
public void Consume(InactivateProgramCommand message)
{
var program = dbContext.Get<ProgramEntity>(message.ProgramId);
program.Inactivate();
serviceBus.Notify(new ProgramInactivatedEvent{ProgramId =
message.ProgramId});
}
And then consuming that new message in another consumer.
This appears to be working fine, but I am wondering if this is the
"preferred" way to do this?
One the things that concern me is the transactions. I have a
NHibernateMessageModule in place similar to the module in Ayende's
Alexandria and when watching the sessions in NHProf I can see that each
session comes in and the first statement is "enlisted session in distributed
transaction with isolation level: ReadCommitted", then the SQL then "commit
transaction".
I am thinking these are two separate transactions and there is NOT one
transaction wrapping them both, which is what I want. I want each consumer
on its own transaction. Is this correct?
Thanks,
Joe
--
You received this message because you are subscribed to the Google Groups
"Rhino Tools Dev" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rhino-tools-dev/-/VwSf7J_A7sUJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rhino-tools-dev?hl=en.