{"action":"created","issue":{"url":"https://api.github.com/repos/Particular/NServiceBus/issues/2668","labels_url":"https://api.github.com/repos/Particular/NServiceBus/issues/2668/labels{/name}","comments_url":"https://api.github.com/repos/Particular/NServiceBus/issues/2668/comments","events_url":"https://api.github.com/repos/Particular/NServiceBus/issues/2668/events","html_url":"https://github.com/Particular/NServiceBus/issues/2668","id":59441841,"number":2668,"title":"Change signature of IMutateOutgoingTransportMessages.MutateOutgoing","user":{"login":"johnsimons","id":122651,"avatar_url":"https://avatars.githubusercontent.com/u/122651?v=3","gravatar_id":"","url":"https://api.github.com/users/johnsimons","html_url":"https://github.com/johnsimons","followers_url":"https://api.github.com/users/johnsimons/followers","following_url":"https://api.github.com/users/johnsimons/following{/other_user}","gists_url":"https://api.github.com/users/johnsimons/gists{/gist_id}","starred_url":"https://api.github.com/users/johnsimons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnsimons/subscriptions","organizations_url":"https://api.github.com/users/johnsimons/orgs","repos_url":"https://api.github.com/users/johnsimons/repos","events_url":"https://api.github.com/users/johnsimons/events{/privacy}","received_events_url":"https://api.github.com/users/johnsimons/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-02T05:59:56Z","updated_at":"2015-03-02T07:32:19Z","closed_at":null,"body":"Currently the signature is:\r\n```c#\r\nvoid MutateOutgoing(LogicalMessage logicalMessage, TransportMessage transportMessage);\r\n```\r\n\r\nThis currently allows for the user to do some really weird things:\r\n```c#\r\npublic void MutateOutgoing(LogicalMessage logicalMessage, TransportMessage transportMessage)\r\n{\r\n    logicalMessage.Headers[\"Boo\"] = \"Foo\";\r\n    logicalMessage.UpdateMessageInstance(new object());\r\n    // ...\r\n}\r\n```\r\n\r\nAs you can see it is possible to mutate the state of `logicalMessage`, even though it does not makes sense.\r\n\r\nAlso, it is not clear that `logicalMessage` refers to the incoming message and `transportMessage` is the message going out.\r\n\r\nI would prefer to have something like (not c#):\r\n```\r\nbody, headers MutateOutgoing(IncomingMessage)\r\n```\r\n\r\nThe `IncomingMessage` would be an immutable type."},"comment":{"url":"https://api.github.com/repos/Particular/NServiceBus/issues/comments/76668930","html_url":"https://github.com/Particular/NServiceBus/issues/2668#issuecomment-76668930","issue_url":"https://api.github.com/repos/Particular/NServiceBus/issues/2668","id":76668930,"user":{"login":"danielmarbach","id":174258,"avatar_url":"https://avatars.githubusercontent.com/u/174258?v=3","gravatar_id":"","url":"https://api.github.com/users/danielmarbach","html_url":"https://github.com/danielmarbach","followers_url":"https://api.github.com/users/danielmarbach/followers","following_url":"https://api.github.com/users/danielmarbach/following{/other_user}","gists_url":"https://api.github.com/users/danielmarbach/gists{/gist_id}","starred_url":"https://api.github.com/users/danielmarbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielmarbach/subscriptions","organizations_url":"https://api.github.com/users/danielmarbach/orgs","repos_url":"https://api.github.com/users/danielmarbach/repos","events_url":"https://api.github.com/users/danielmarbach/events{/privacy}","received_events_url":"https://api.github.com/users/danielmarbach/received_events","type":"User","site_admin":false},"created_at":"2015-03-02T07:32:19Z","updated_at":"2015-03-02T07:32:19Z","body":"Here is my current thought:\r\n\r\nWhen we take handler context into consideration, some weirdness around mutators and the plans to change the transport seam we need to align where we want to be going. Let's setup a call"}}