{"action":"created","issue":{"url":"https://api.github.com/repos/Particular/NServiceBus/issues/3451","repository_url":"https://api.github.com/repos/Particular/NServiceBus","labels_url":"https://api.github.com/repos/Particular/NServiceBus/issues/3451/labels{/name}","comments_url":"https://api.github.com/repos/Particular/NServiceBus/issues/3451/comments","events_url":"https://api.github.com/repos/Particular/NServiceBus/issues/3451/events","html_url":"https://github.com/Particular/NServiceBus/issues/3451","id":133123799,"number":3451,"title":"Is TransportTransactionMode.SendsAtomicWithReceive relevant given our behavior in v6?","user":{"login":"indualagarsamy","id":854553,"avatar_url":"https://avatars.githubusercontent.com/u/854553?v=3","gravatar_id":"","url":"https://api.github.com/users/indualagarsamy","html_url":"https://github.com/indualagarsamy","followers_url":"https://api.github.com/users/indualagarsamy/followers","following_url":"https://api.github.com/users/indualagarsamy/following{/other_user}","gists_url":"https://api.github.com/users/indualagarsamy/gists{/gist_id}","starred_url":"https://api.github.com/users/indualagarsamy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indualagarsamy/subscriptions","organizations_url":"https://api.github.com/users/indualagarsamy/orgs","repos_url":"https://api.github.com/users/indualagarsamy/repos","events_url":"https://api.github.com/users/indualagarsamy/events{/privacy}","received_events_url":"https://api.github.com/users/indualagarsamy/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Particular/NServiceBus/labels/Tag:%20Core%20v6","name":"Tag: Core v6","color":"ffff00"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-02-12T00:11:44Z","updated_at":"2016-02-16T08:31:53Z","closed_at":null,"body":"I was discussing transaction behavior with @bording and we came across this:\r\n\r\nAs described here we do batched dispatch in V6: http://docs.particular.net/nservicebus/messaging/batched-dispatch#behavior-in-version-6-and-higher\r\n\r\nIf I don't want to do batched sends, then I need to do the below when sending the message:\r\n```c#\r\nSendOptions options = new SendOptions();\r\noptions.SetDestination(\"TranOff\");\r\noptions.RequireImmediateDispatch();\r\nawait context.Send(new SayHello(), options);\r\n```\r\n\r\nIf I do the above, regardless of the transaction mode, i.e.`TransportTransactionMode.TransactionScope` or `TransportTransactionMode.SendsAtomicWithReceive`, the message is always sent. \r\n\r\nThe other case is, when I set to TransportTransactionMode.SendsAtomicWithReceive but don't use RequireImmediateDispatch, again the behavior is not expected.\r\n\r\nFor example, endpoint Config:\r\n\r\n```c#\r\nendpointConfiguration.UseTransport<MsmqTransport>()\r\n.Transactions(TransportTransactionMode.SendsAtomicWithReceive);         \r\n```\r\nIn the following code, the `SayHello`message is never dispatched:\r\n\r\n```c#\r\npublic class DoSomethingHandler : IHandleMessages<DoSomething>\r\n    {\r\n        public async Task Handle(DoSomething message, IMessageHandlerContext context)\r\n        {\r\n            Console.WriteLine(\"Received message!\");\r\n            await context.SendLocal(new SayHello());\r\n            throw new Exception(\"BAD STUFF!\");\r\n            \r\n        }\r\n    }\r\n```\r\n\r\nSo, when do I need to use `TransportTransactionMode.SendsAtomicWithReceive` ?\r\nAs I understand, this mode is only relevant for MSMQ and SQLServer transports.\r\n"},"comment":{"url":"https://api.github.com/repos/Particular/NServiceBus/issues/comments/184573261","html_url":"https://github.com/Particular/NServiceBus/issues/3451#issuecomment-184573261","issue_url":"https://api.github.com/repos/Particular/NServiceBus/issues/3451","id":184573261,"user":{"login":"weralabaj","id":7335079,"avatar_url":"https://avatars.githubusercontent.com/u/7335079?v=3","gravatar_id":"","url":"https://api.github.com/users/weralabaj","html_url":"https://github.com/weralabaj","followers_url":"https://api.github.com/users/weralabaj/followers","following_url":"https://api.github.com/users/weralabaj/following{/other_user}","gists_url":"https://api.github.com/users/weralabaj/gists{/gist_id}","starred_url":"https://api.github.com/users/weralabaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weralabaj/subscriptions","organizations_url":"https://api.github.com/users/weralabaj/orgs","repos_url":"https://api.github.com/users/weralabaj/repos","events_url":"https://api.github.com/users/weralabaj/events{/privacy}","received_events_url":"https://api.github.com/users/weralabaj/received_events","type":"User","site_admin":false},"created_at":"2016-02-16T08:31:53Z","updated_at":"2016-02-16T08:31:53Z","body":"@andreasohlund I think this one is worth doing https://github.com/Particular/docs.particular.net/issues/1176. Something like listing in the box what transports support this option, so it's clearly visible at first sight."}}