{"action":"created","issue":{"url":"https://api.github.com/repos/Particular/NServiceBus/issues/2720","labels_url":"https://api.github.com/repos/Particular/NServiceBus/issues/2720/labels{/name}","comments_url":"https://api.github.com/repos/Particular/NServiceBus/issues/2720/comments","events_url":"https://api.github.com/repos/Particular/NServiceBus/issues/2720/events","html_url":"https://github.com/Particular/NServiceBus/pull/2720","id":71591521,"number":2720,"title":"Introducing PublishOptions to allow users to extend the publish api","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},"labels":[{"url":"https://api.github.com/repos/Particular/NServiceBus/labels/Improvement","name":"Improvement","color":"22BB88"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/Particular/NServiceBus/milestones/62","html_url":"https://github.com/Particular/NServiceBus/milestones/6.0.0","labels_url":"https://api.github.com/repos/Particular/NServiceBus/milestones/62/labels","id":704266,"number":62,"title":"6.0.0","description":"Setting up deployment process","creator":{"login":"SimonCropp","id":122666,"avatar_url":"https://avatars.githubusercontent.com/u/122666?v=3","gravatar_id":"","url":"https://api.github.com/users/SimonCropp","html_url":"https://github.com/SimonCropp","followers_url":"https://api.github.com/users/SimonCropp/followers","following_url":"https://api.github.com/users/SimonCropp/following{/other_user}","gists_url":"https://api.github.com/users/SimonCropp/gists{/gist_id}","starred_url":"https://api.github.com/users/SimonCropp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimonCropp/subscriptions","organizations_url":"https://api.github.com/users/SimonCropp/orgs","repos_url":"https://api.github.com/users/SimonCropp/repos","events_url":"https://api.github.com/users/SimonCropp/events{/privacy}","received_events_url":"https://api.github.com/users/SimonCropp/received_events","type":"User","site_admin":false},"open_issues":28,"closed_issues":19,"state":"open","created_at":"2014-06-28T13:41:09Z","updated_at":"2015-04-29T22:28:19Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-04-28T13:31:35Z","updated_at":"2015-04-29T23:09:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Particular/NServiceBus/pulls/2720","html_url":"https://github.com/Particular/NServiceBus/pull/2720","diff_url":"https://github.com/Particular/NServiceBus/pull/2720.diff","patch_url":"https://github.com/Particular/NServiceBus/pull/2720.patch"},"body":"* This one still doesn't allow headers to be set for events, I'll raise that in a separate pull\r\n\r\n* We need to look at SendOptions and decide if there are things on there that should be hidden away as well. Eg. destination shouldn't really be in the face of the users. I'll get another pull going for this\r\n\r\n* The extensions are now strongly typed and available on the outgoing context(s)\r\n\r\n* We need a way to pass extension context items on to the transports. We'll handle that in a separate pull as well"},"comment":{"url":"https://api.github.com/repos/Particular/NServiceBus/issues/comments/97611200","html_url":"https://github.com/Particular/NServiceBus/pull/2720#issuecomment-97611200","issue_url":"https://api.github.com/repos/Particular/NServiceBus/issues/2720","id":97611200,"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},"created_at":"2015-04-29T23:09:47Z","updated_at":"2015-04-29T23:09:47Z","body":"I would also have non typed options in `ExtensionContext`, at the moment the current design makes the consumer have a class per setting, that IMO is a burden, eg:\r\n```c#\r\nsendOptions.GetContext().Set(new MyExtensionData { SomeValue = \"I did it!\" });\r\n// instead of just\r\nsendOptions.GetContext().Set(\"SomeValue\", \"I did it!\");\r\n```\r\nAlso it won't allow anonymous types, eg:\r\n```c#\r\nsendOptions.GetContext().Set(new {Foo = \"sdfsdfdsf\"}); // You can set it, but u can't get to me!\r\n```\r\n\r\nThinking more about it, I actually think that having a types api is confusing and error prone, users can override each others settings, eg:\r\n```c#\r\nsendOptions.GetContext().Set(\"My value\");\r\n\r\n// and later on some other call\r\n\r\nsendOptions.GetContext().Set(\"This overrides previously set string!\");\r\n```\r\n\r\nI do prefer the explicitness of the \"key/value\" pair, so :-1: to have a typed api for this scenario."}}