{"action":"created","issue":{"url":"https://api.github.com/repos/Shuttle/shuttle-esb/issues/49","labels_url":"https://api.github.com/repos/Shuttle/shuttle-esb/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/Shuttle/shuttle-esb/issues/49/comments","events_url":"https://api.github.com/repos/Shuttle/shuttle-esb/issues/49/events","html_url":"https://github.com/Shuttle/shuttle-esb/issues/49","id":108077890,"number":49,"title":"MsmqQueue currently ignores TransactionScope","user":{"login":"ltvan","id":545025,"avatar_url":"https://avatars.githubusercontent.com/u/545025?v=3","gravatar_id":"","url":"https://api.github.com/users/ltvan","html_url":"https://github.com/ltvan","followers_url":"https://api.github.com/users/ltvan/followers","following_url":"https://api.github.com/users/ltvan/following{/other_user}","gists_url":"https://api.github.com/users/ltvan/gists{/gist_id}","starred_url":"https://api.github.com/users/ltvan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ltvan/subscriptions","organizations_url":"https://api.github.com/users/ltvan/orgs","repos_url":"https://api.github.com/users/ltvan/repos","events_url":"https://api.github.com/users/ltvan/events{/privacy}","received_events_url":"https://api.github.com/users/ltvan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Shuttle/shuttle-esb/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":21,"created_at":"2015-09-24T07:52:16Z","updated_at":"2015-10-04T06:55:58Z","closed_at":null,"body":"Currently MsmqQueue always sent messages with MessageQueueTransactionType.Single. This defeats the purpose of TransactionScope. I suggest that it should be like this:\r\n\r\n```c#\r\n    if (Transaction.Current != null)\r\n    {\r\n        queue.Send(sendMessage, MessageQueueTransactionType.Automatic);\r\n    }\r\n    else\r\n    {\r\n        queue.Send(sendMessage, MessageQueueTransactionType.Single);\r\n    }\r\n```\r\n\r\nBTW, I would like to ask if I should post issue like this here or in the [shuttle-esb-msmq](https://github.com/Shuttle/shuttle-esb-msmq)."},"comment":{"url":"https://api.github.com/repos/Shuttle/shuttle-esb/issues/comments/145323470","html_url":"https://github.com/Shuttle/shuttle-esb/issues/49#issuecomment-145323470","issue_url":"https://api.github.com/repos/Shuttle/shuttle-esb/issues/49","id":145323470,"user":{"login":"eben-roux","id":5379436,"avatar_url":"https://avatars.githubusercontent.com/u/5379436?v=3","gravatar_id":"","url":"https://api.github.com/users/eben-roux","html_url":"https://github.com/eben-roux","followers_url":"https://api.github.com/users/eben-roux/followers","following_url":"https://api.github.com/users/eben-roux/following{/other_user}","gists_url":"https://api.github.com/users/eben-roux/gists{/gist_id}","starred_url":"https://api.github.com/users/eben-roux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eben-roux/subscriptions","organizations_url":"https://api.github.com/users/eben-roux/orgs","repos_url":"https://api.github.com/users/eben-roux/repos","events_url":"https://api.github.com/users/eben-roux/events{/privacy}","received_events_url":"https://api.github.com/users/eben-roux/received_events","type":"User","site_admin":false},"created_at":"2015-10-04T06:55:58Z","updated_at":"2015-10-04T06:55:58Z","body":"I have giving this some more thought and I am not entirely happy with the current solution.  It feels somewhat like a hack.\r\n\r\nI am considering adding another interface for queues called something like `IQueueEnqueue` that will look something like this:\r\n\r\n   void Enqueue(Guid messageId, Stream stream, object parameters);\r\n\r\nThe `TransportMessageConfigurator` could be renamed to something more generic so that one could configure a `QueueParameters` object and then the `DispatchTransportMessageObserver` could safe cast to `IQueueEnqueue` if there are parameters and call through the new interface.  Having `QueueParameters` and not being able to cast to `IQueueEnqueue` would result in an exception.\r\n\r\nThen one could have some container object that contains arbitrary queue specific information that could be passed to the queue implementation.  In this way one could pass the `IDbConnection` and transaction across for consumption.\r\n\r\nWhile I am at it I am considering changing the whole data layer database connection caching business.  Having these thread static bits are troublesome.  It may be better just passing the connection data along in the call since currently I am passing a `DataSource`.  May as well replace the `DataSource` with the connection :)\r\n\r\nI have tried to keep the queue implementation as independent as possible but I guess there may be some use in passing data to it somehow.  If, at a later stage, passing of data is required for the other methods one could implement specific interfaces for those also.\r\n\r\nLet me know what you think."}}