{"action":"created","issue":{"url":"https://api.github.com/repos/Particular/NServiceBus/issues/3529","repository_url":"https://api.github.com/repos/Particular/NServiceBus","labels_url":"https://api.github.com/repos/Particular/NServiceBus/issues/3529/labels{/name}","comments_url":"https://api.github.com/repos/Particular/NServiceBus/issues/3529/comments","events_url":"https://api.github.com/repos/Particular/NServiceBus/issues/3529/events","html_url":"https://github.com/Particular/NServiceBus/pull/3529","id":137393761,"number":3529,"title":"[WIP] Data from IncomingMessage is accessed over the context only.","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},"labels":[{"url":"https://api.github.com/repos/Particular/NServiceBus/labels/State:%20In%20Progress","name":"State: In Progress","color":"ededed"},{"url":"https://api.github.com/repos/Particular/NServiceBus/labels/Type:%20Spike","name":"Type: Spike","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-29T22:11:11Z","updated_at":"2016-03-01T09:37:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Particular/NServiceBus/pulls/3529","html_url":"https://github.com/Particular/NServiceBus/pull/3529","diff_url":"https://github.com/Particular/NServiceBus/pull/3529.diff","patch_url":"https://github.com/Particular/NServiceBus/pull/3529.patch"},"body":"We have a mess in how we expose and access data from `IncomingMessage`. Once we access it over `context.Message.Headers`, once over `context.Headers` and so forth. This PR aims to move everything to the context which makes the API more concise. As it stands right now I think the API is not releasable. There are too many unanswered questions when you as a user explore the API.\r\n\r\nLike:\r\n\r\n* Should I access and modify the headers over the `context.Message` instance or `context.Headers` or even both? The fact that we do some magic reference passing is not obvious by the API.\r\n\r\n## Questions\r\n\r\n* On the outgoing pipeline should we just expose methods to access the incoming message headers or a tuple of MessageId and Headers?\r\n* RevertToOriginalBodyIfNeeded needs to be redundantly implemented both on transport receive and incoming physical. Is that OK?\r\n* I still don't like that we have `MessageHeaders` and `Headers` exposed inside the pipeline only for the purpose to make the user access to headers expose `IReadonlyDictionary`. I'm contemplating to streamline it and just expose `Dictionary<string, string>` but make a copy of the headers. Thoughts?\r\n* `CustomRetryPolicy` would expose an `ITransportReceiveContext` instead of `IncomingMessage`. Ok?\r\n* Should we still keep around `IncomingMessage` as an internal class to wrap the body and reverting of the body? This might reduce code redundancy on the contexts described above. Thoughts?\r\n "},"comment":{"url":"https://api.github.com/repos/Particular/NServiceBus/issues/comments/190634652","html_url":"https://github.com/Particular/NServiceBus/pull/3529#issuecomment-190634652","issue_url":"https://api.github.com/repos/Particular/NServiceBus/issues/3529","id":190634652,"user":{"login":"andreasohlund","id":125028,"avatar_url":"https://avatars.githubusercontent.com/u/125028?v=3","gravatar_id":"","url":"https://api.github.com/users/andreasohlund","html_url":"https://github.com/andreasohlund","followers_url":"https://api.github.com/users/andreasohlund/followers","following_url":"https://api.github.com/users/andreasohlund/following{/other_user}","gists_url":"https://api.github.com/users/andreasohlund/gists{/gist_id}","starred_url":"https://api.github.com/users/andreasohlund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreasohlund/subscriptions","organizations_url":"https://api.github.com/users/andreasohlund/orgs","repos_url":"https://api.github.com/users/andreasohlund/repos","events_url":"https://api.github.com/users/andreasohlund/events{/privacy}","received_events_url":"https://api.github.com/users/andreasohlund/received_events","type":"User","site_admin":false},"created_at":"2016-03-01T09:37:20Z","updated_at":"2016-03-01T09:37:20Z","body":"Labeling as `Type: Spike` and prefixing with [WIP]"}}