{"action":"created","comment":{"url":"https://api.github.com/repos/Particular/NServiceBus/pulls/comments/69682047","id":69682047,"diff_hunk":"@@ -11,19 +12,31 @@ public FileRoutingTableFeature()\n             {\n                 s.SetDefault(CheckIntervalSettingsKey, TimeSpan.FromSeconds(30));\n                 s.SetDefault(MaxLoadAttemptsSettingsKey, 10);\n+                s.SetDefault(FilePathSettingsKey, \"instance-mapping.xml\");\n             });\n             DependsOn<RoutingFeature>();\n         }\n \n         protected internal override void Setup(FeatureConfigurationContext context)\n         {\n             var filePath = context.Settings.Get<string>(FilePathSettingsKey);\n+            if (!Path.IsPathRooted(filePath))\n+            {\n+                filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, filePath);\n+            }\n+\n+            if (!File.Exists(filePath))\n+            {\n+                return;\n+            }\n+\n             var checkInterval = context.Settings.Get<TimeSpan>(CheckIntervalSettingsKey);\n             var maxLoadAttempts = context.Settings.Get<int>(MaxLoadAttemptsSettingsKey);\n \n             var endpointInstances = context.Settings.Get<EndpointInstances>();\n \n             var fileRoutingTable = new FileRoutingTable(filePath, checkInterval, new AsyncTimer(), new RoutingFileAccess(), maxLoadAttempts);\n+            fileRoutingTable.ReloadData();","path":"src/NServiceBus.Core/Routing/FileBasedDynamicRouting/FileRoutingTableFeature.cs","position":36,"original_position":36,"commit_id":"9951e97208dab5eb789bd70e2415404bcd9069b1","original_commit_id":"9951e97208dab5eb789bd70e2415404bcd9069b1","user":{"login":"timbussmann","id":3524870,"avatar_url":"https://avatars.githubusercontent.com/u/3524870?v=3","gravatar_id":"","url":"https://api.github.com/users/timbussmann","html_url":"https://github.com/timbussmann","followers_url":"https://api.github.com/users/timbussmann/followers","following_url":"https://api.github.com/users/timbussmann/following{/other_user}","gists_url":"https://api.github.com/users/timbussmann/gists{/gist_id}","starred_url":"https://api.github.com/users/timbussmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timbussmann/subscriptions","organizations_url":"https://api.github.com/users/timbussmann/orgs","repos_url":"https://api.github.com/users/timbussmann/repos","events_url":"https://api.github.com/users/timbussmann/events{/privacy}","received_events_url":"https://api.github.com/users/timbussmann/received_events","type":"User","site_admin":false},"body":"> By calling this here, you're trying to reintroduce a setup check instead on first message send, right?\r\n\r\nyes, I wanted to trade this back to a startup check instead a \"throws on the first send and afterwards it's swallowed\".\r\n\r\ngood point about the errorMessage, will see what we can do there.","created_at":"2016-07-06T06:49:43Z","updated_at":"2016-07-06T06:49:43Z","html_url":"https://github.com/Particular/NServiceBus/pull/3900#discussion_r69682047","pull_request_url":"https://api.github.com/repos/Particular/NServiceBus/pulls/3900","_links":{"self":{"href":"https://api.github.com/repos/Particular/NServiceBus/pulls/comments/69682047"},"html":{"href":"https://github.com/Particular/NServiceBus/pull/3900#discussion_r69682047"},"pull_request":{"href":"https://api.github.com/repos/Particular/NServiceBus/pulls/3900"}}},"pull_request":{"url":"https://api.github.com/repos/Particular/NServiceBus/pulls/3900","id":76008061,"html_url":"https://github.com/Particular/NServiceBus/pull/3900","diff_url":"https://github.com/Particular/NServiceBus/pull/3900.diff","patch_url":"https://github.com/Particular/NServiceBus/pull/3900.patch","issue_url":"https://api.github.com/repos/Particular/NServiceBus/issues/3900","number":3900,"state":"open","locked":false,"title":"[WIP] Auto enable instance mapping","user":{"login":"timbussmann","id":3524870,"avatar_url":"https://avatars.githubusercontent.com/u/3524870?v=3","gravatar_id":"","url":"https://api.github.com/users/timbussmann","html_url":"https://github.com/timbussmann","followers_url":"https://api.github.com/users/timbussmann/followers","following_url":"https://api.github.com/users/timbussmann/following{/other_user}","gists_url":"https://api.github.com/users/timbussmann/gists{/gist_id}","starred_url":"https://api.github.com/users/timbussmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timbussmann/subscriptions","organizations_url":"https://api.github.com/users/timbussmann/orgs","repos_url":"https://api.github.com/users/timbussmann/repos","events_url":"https://api.github.com/users/timbussmann/events{/privacy}","received_events_url":"https://api.github.com/users/timbussmann/received_events","type":"User","site_admin":false},"body":"Connects to Particular/V6Launch#68\r\n\r\nChanges:\r\n\r\n* Change schema to allow empty `endpoints` and `endpoint` elements\r\n* Only use one attempt to read instance mapping file. If it fails it will blow at startup or try again after the configured checkInterval. Is there a valid scenario which requires the `maxLoadAttempts` configuration?\r\n* Load mapping file initially during feature setup for validation and initial data purpose\r\n* uses AppDomain.CurrentDomain.BaseDirectory as root path for relative mapping file paths\r\n* Open mapping file with `FileShare.Read` instead of `FileShare.ReadWrite`, not sure about that, is there any reason for ReadWrite?\r\n* remove `FileBasedEndpointInstanceMapping`\r\n* Auto-enables the mapping file when using Msmq transport\r\n  * it will not read the file and not set up dynamic rules when there is no file at startup time (can be empty though)\r\n  * if a file is found, the dynamic rule is added and a timer will constantly reread the mapping file\r\n\r\nTodos:\r\n\r\n* [x] Cleanup mapping file in tests\r\n* [ ] Avoid dynamic rules and other performance impacts when no instance mapping file is used.\r\n* [x] Add API for custom mapping file path\r\n* [ ] Update docs to changed API","created_at":"2016-07-01T16:52:32Z","updated_at":"2016-07-06T06:49:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7dee2fb92a6c597728e84c58dbcbb709aa806b38","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Particular/NServiceBus/pulls/3900/commits","review_comments_url":"https://api.github.com/repos/Particular/NServiceBus/pulls/3900/comments","review_comment_url":"https://api.github.com/repos/Particular/NServiceBus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Particular/NServiceBus/issues/3900/comments","statuses_url":"https://api.github.com/repos/Particular/NServiceBus/statuses/9951e97208dab5eb789bd70e2415404bcd9069b1","head":{"label":"Particular:auto-enable-instance-mapping","ref":"auto-enable-instance-mapping","sha":"9951e97208dab5eb789bd70e2415404bcd9069b1","user":{"login":"Particular","id":5038441,"avatar_url":"https://avatars.githubusercontent.com/u/5038441?v=3","gravatar_id":"","url":"https://api.github.com/users/Particular","html_url":"https://github.com/Particular","followers_url":"https://api.github.com/users/Particular/followers","following_url":"https://api.github.com/users/Particular/following{/other_user}","gists_url":"https://api.github.com/users/Particular/gists{/gist_id}","starred_url":"https://api.github.com/users/Particular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Particular/subscriptions","organizations_url":"https://api.github.com/users/Particular/orgs","repos_url":"https://api.github.com/users/Particular/repos","events_url":"https://api.github.com/users/Particular/events{/privacy}","received_events_url":"https://api.github.com/users/Particular/received_events","type":"Organization","site_admin":false},"repo":{"id":1056713,"name":"NServiceBus","full_name":"Particular/NServiceBus","owner":{"login":"Particular","id":5038441,"avatar_url":"https://avatars.githubusercontent.com/u/5038441?v=3","gravatar_id":"","url":"https://api.github.com/users/Particular","html_url":"https://github.com/Particular","followers_url":"https://api.github.com/users/Particular/followers","following_url":"https://api.github.com/users/Particular/following{/other_user}","gists_url":"https://api.github.com/users/Particular/gists{/gist_id}","starred_url":"https://api.github.com/users/Particular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Particular/subscriptions","organizations_url":"https://api.github.com/users/Particular/orgs","repos_url":"https://api.github.com/users/Particular/repos","events_url":"https://api.github.com/users/Particular/events{/privacy}","received_events_url":"https://api.github.com/users/Particular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Particular/NServiceBus","description":"The most popular service bus for .NET","fork":false,"url":"https://api.github.com/repos/Particular/NServiceBus","forks_url":"https://api.github.com/repos/Particular/NServiceBus/forks","keys_url":"https://api.github.com/repos/Particular/NServiceBus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Particular/NServiceBus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Particular/NServiceBus/teams","hooks_url":"https://api.github.com/repos/Particular/NServiceBus/hooks","issue_events_url":"https://api.github.com/repos/Particular/NServiceBus/issues/events{/number}","events_url":"https://api.github.com/repos/Particular/NServiceBus/events","assignees_url":"https://api.github.com/repos/Particular/NServiceBus/assignees{/user}","branches_url":"https://api.github.com/repos/Particular/NServiceBus/branches{/branch}","tags_url":"https://api.github.com/repos/Particular/NServiceBus/tags","blobs_url":"https://api.github.com/repos/Particular/NServiceBus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Particular/NServiceBus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Particular/NServiceBus/git/refs{/sha}","trees_url":"https://api.github.com/repos/Particular/NServiceBus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Particular/NServiceBus/statuses/{sha}","languages_url":"https://api.github.com/repos/Particular/NServiceBus/languages","stargazers_url":"https://api.github.com/repos/Particular/NServiceBus/stargazers","contributors_url":"https://api.github.com/repos/Particular/NServiceBus/contributors","subscribers_url":"https://api.github.com/repos/Particular/NServiceBus/subscribers","subscription_url":"https://api.github.com/repos/Particular/NServiceBus/subscription","commits_url":"https://api.github.com/repos/Particular/NServiceBus/commits{/sha}","git_commits_url":"https://api.github.com/repos/Particular/NServiceBus/git/commits{/sha}","comments_url":"https://api.github.com/repos/Particular/NServiceBus/comments{/number}","issue_comment_url":"https://api.github.com/repos/Particular/NServiceBus/issues/comments{/number}","contents_url":"https://api.github.com/repos/Particular/NServiceBus/contents/{+path}","compare_url":"https://api.github.com/repos/Particular/NServiceBus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Particular/NServiceBus/merges","archive_url":"https://api.github.com/repos/Particular/NServiceBus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Particular/NServiceBus/downloads","issues_url":"https://api.github.com/repos/Particular/NServiceBus/issues{/number}","pulls_url":"https://api.github.com/repos/Particular/NServiceBus/pulls{/number}","milestones_url":"https://api.github.com/repos/Particular/NServiceBus/milestones{/number}","notifications_url":"https://api.github.com/repos/Particular/NServiceBus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Particular/NServiceBus/labels{/name}","releases_url":"https://api.github.com/repos/Particular/NServiceBus/releases{/id}","deployments_url":"https://api.github.com/repos/Particular/NServiceBus/deployments","created_at":"2010-11-06T12:54:52Z","updated_at":"2016-07-04T23:12:46Z","pushed_at":"2016-07-06T05:55:13Z","git_url":"git://github.com/Particular/NServiceBus.git","ssh_url":"git@github.com:Particular/NServiceBus.git","clone_url":"https://github.com/Particular/NServiceBus.git","svn_url":"https://github.com/Particular/NServiceBus","homepage":"http://particular.net/nservicebus","size":178340,"stargazers_count":937,"watchers_count":937,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":507,"mirror_url":null,"open_issues_count":241,"forks":507,"open_issues":241,"watchers":937,"default_branch":"develop"}},"base":{"label":"Particular:release-6.0.0","ref":"release-6.0.0","sha":"65079f6771750d15eddab9cf3be36beada0aaa01","user":{"login":"Particular","id":5038441,"avatar_url":"https://avatars.githubusercontent.com/u/5038441?v=3","gravatar_id":"","url":"https://api.github.com/users/Particular","html_url":"https://github.com/Particular","followers_url":"https://api.github.com/users/Particular/followers","following_url":"https://api.github.com/users/Particular/following{/other_user}","gists_url":"https://api.github.com/users/Particular/gists{/gist_id}","starred_url":"https://api.github.com/users/Particular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Particular/subscriptions","organizations_url":"https://api.github.com/users/Particular/orgs","repos_url":"https://api.github.com/users/Particular/repos","events_url":"https://api.github.com/users/Particular/events{/privacy}","received_events_url":"https://api.github.com/users/Particular/received_events","type":"Organization","site_admin":false},"repo":{"id":1056713,"name":"NServiceBus","full_name":"Particular/NServiceBus","owner":{"login":"Particular","id":5038441,"avatar_url":"https://avatars.githubusercontent.com/u/5038441?v=3","gravatar_id":"","url":"https://api.github.com/users/Particular","html_url":"https://github.com/Particular","followers_url":"https://api.github.com/users/Particular/followers","following_url":"https://api.github.com/users/Particular/following{/other_user}","gists_url":"https://api.github.com/users/Particular/gists{/gist_id}","starred_url":"https://api.github.com/users/Particular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Particular/subscriptions","organizations_url":"https://api.github.com/users/Particular/orgs","repos_url":"https://api.github.com/users/Particular/repos","events_url":"https://api.github.com/users/Particular/events{/privacy}","received_events_url":"https://api.github.com/users/Particular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Particular/NServiceBus","description":"The most popular service bus for .NET","fork":false,"url":"https://api.github.com/repos/Particular/NServiceBus","forks_url":"https://api.github.com/repos/Particular/NServiceBus/forks","keys_url":"https://api.github.com/repos/Particular/NServiceBus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Particular/NServiceBus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Particular/NServiceBus/teams","hooks_url":"https://api.github.com/repos/Particular/NServiceBus/hooks","issue_events_url":"https://api.github.com/repos/Particular/NServiceBus/issues/events{/number}","events_url":"https://api.github.com/repos/Particular/NServiceBus/events","assignees_url":"https://api.github.com/repos/Particular/NServiceBus/assignees{/user}","branches_url":"https://api.github.com/repos/Particular/NServiceBus/branches{/branch}","tags_url":"https://api.github.com/repos/Particular/NServiceBus/tags","blobs_url":"https://api.github.com/repos/Particular/NServiceBus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Particular/NServiceBus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Particular/NServiceBus/git/refs{/sha}","trees_url":"https://api.github.com/repos/Particular/NServiceBus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Particular/NServiceBus/statuses/{sha}","languages_url":"https://api.github.com/repos/Particular/NServiceBus/languages","stargazers_url":"https://api.github.com/repos/Particular/NServiceBus/stargazers","contributors_url":"https://api.github.com/repos/Particular/NServiceBus/contributors","subscribers_url":"https://api.github.com/repos/Particular/NServiceBus/subscribers","subscription_url":"https://api.github.com/repos/Particular/NServiceBus/subscription","commits_url":"https://api.github.com/repos/Particular/NServiceBus/commits{/sha}","git_commits_url":"https://api.github.com/repos/Particular/NServiceBus/git/commits{/sha}","comments_url":"https://api.github.com/repos/Particular/NServiceBus/comments{/number}","issue_comment_url":"https://api.github.com/repos/Particular/NServiceBus/issues/comments{/number}","contents_url":"https://api.github.com/repos/Particular/NServiceBus/contents/{+path}","compare_url":"https://api.github.com/repos/Particular/NServiceBus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Particular/NServiceBus/merges","archive_url":"https://api.github.com/repos/Particular/NServiceBus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Particular/NServiceBus/downloads","issues_url":"https://api.github.com/repos/Particular/NServiceBus/issues{/number}","pulls_url":"https://api.github.com/repos/Particular/NServiceBus/pulls{/number}","milestones_url":"https://api.github.com/repos/Particular/NServiceBus/milestones{/number}","notifications_url":"https://api.github.com/repos/Particular/NServiceBus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Particular/NServiceBus/labels{/name}","releases_url":"https://api.github.com/repos/Particular/NServiceBus/releases{/id}","deployments_url":"https://api.github.com/repos/Particular/NServiceBus/deployments","created_at":"2010-11-06T12:54:52Z","updated_at":"2016-07-04T23:12:46Z","pushed_at":"2016-07-06T05:55:13Z","git_url":"git://github.com/Particular/NServiceBus.git","ssh_url":"git@github.com:Particular/NServiceBus.git","clone_url":"https://github.com/Particular/NServiceBus.git","svn_url":"https://github.com/Particular/NServiceBus","homepage":"http://particular.net/nservicebus","size":178340,"stargazers_count":937,"watchers_count":937,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":507,"mirror_url":null,"open_issues_count":241,"forks":507,"open_issues":241,"watchers":937,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Particular/NServiceBus/pulls/3900"},"html":{"href":"https://github.com/Particular/NServiceBus/pull/3900"},"issue":{"href":"https://api.github.com/repos/Particular/NServiceBus/issues/3900"},"comments":{"href":"https://api.github.com/repos/Particular/NServiceBus/issues/3900/comments"},"review_comments":{"href":"https://api.github.com/repos/Particular/NServiceBus/pulls/3900/comments"},"review_comment":{"href":"https://api.github.com/repos/Particular/NServiceBus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Particular/NServiceBus/pulls/3900/commits"},"statuses":{"href":"https://api.github.com/repos/Particular/NServiceBus/statuses/9951e97208dab5eb789bd70e2415404bcd9069b1"}}}}
{"actor":{"display_login":"timbussmann"}}