{"action":"created","comment":{"url":"https://api.github.com/repos/Netflix/karyon/pulls/comments/36487415","id":36487415,"diff_hunk":"@@ -0,0 +1,43 @@\n+package com.netflix.karyon.eureka;\n+\n+import com.google.inject.AbstractModule;\n+import com.netflix.appinfo.EurekaInstanceConfig;\n+import com.netflix.appinfo.HealthCheckHandler;\n+import com.netflix.appinfo.InstanceInfo;\n+import com.netflix.appinfo.providers.EurekaConfigBasedInstanceInfoProvider;\n+import com.netflix.archaius.guice.ArchaiusModule;\n+import com.netflix.discovery.DiscoveryClient;\n+import com.netflix.discovery.EurekaClient;\n+import com.netflix.discovery.EurekaClientConfig;\n+\n+/**\n+ * Add this module to your project to enable Eureka client and registration\n+ * \n+ * @author elandau\n+ *\n+ */\n+public final class EurekaModule extends AbstractModule {\n+    @Override\n+    protected void configure() {\n+    \tinstall(new ArchaiusModule());\n+    \t\n+    \t// Bindings for eureka\n+        bind(EurekaInstanceConfig.class).to(KaryonEurekaInstanceConfig.class);\n+        bind(EurekaClientConfig.class).to(KaryonEurekaClientConfig.class);\n+        bind(InstanceInfo.class).toProvider(EurekaConfigBasedInstanceInfoProvider.class);\n+        bind(EurekaClient.class).to(DiscoveryClient.class);\n+\n+        // Connect Eureka's HealtCheckHandler to injector lifecycle + HealthCheck\n+        bind(HealthCheckHandler.class).to(KaryonHealthCheckHandler.class);\n+    }\n+    \n+    @Override\n+    public boolean equals(Object obj) {\n+        return EurekaModule.class.equals(obj.getClass());","path":"karyon3-eureka/src/main/java/com/netflix/karyon/eureka/EurekaModule.java","position":36,"original_position":36,"commit_id":"5ae6a9d520171fafd412045a420c7eba02c3213e","original_commit_id":"5ae6a9d520171fafd412045a420c7eba02c3213e","user":{"login":"elandau","id":913564,"avatar_url":"https://avatars.githubusercontent.com/u/913564?v=3","gravatar_id":"","url":"https://api.github.com/users/elandau","html_url":"https://github.com/elandau","followers_url":"https://api.github.com/users/elandau/followers","following_url":"https://api.github.com/users/elandau/following{/other_user}","gists_url":"https://api.github.com/users/elandau/gists{/gist_id}","starred_url":"https://api.github.com/users/elandau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elandau/subscriptions","organizations_url":"https://api.github.com/users/elandau/orgs","repos_url":"https://api.github.com/users/elandau/repos","events_url":"https://api.github.com/users/elandau/events{/privacy}","received_events_url":"https://api.github.com/users/elandau/received_events","type":"User","site_admin":false},"body":"All modules should have this style of equals and hashCode to dedup duplicate installs.  Note that modules should also be final to avoid inheritance.  Bindings should be overwritten using Guice's Modules.override instead of inheritance.","created_at":"2015-08-07T02:51:41Z","updated_at":"2015-08-07T02:51:41Z","html_url":"https://github.com/Netflix/karyon/pull/252#discussion_r36487415","pull_request_url":"https://api.github.com/repos/Netflix/karyon/pulls/252","_links":{"self":{"href":"https://api.github.com/repos/Netflix/karyon/pulls/comments/36487415"},"html":{"href":"https://github.com/Netflix/karyon/pull/252#discussion_r36487415"},"pull_request":{"href":"https://api.github.com/repos/Netflix/karyon/pulls/252"}}},"pull_request":{"url":"https://api.github.com/repos/Netflix/karyon/pulls/252","id":41754433,"html_url":"https://github.com/Netflix/karyon/pull/252","diff_url":"https://github.com/Netflix/karyon/pull/252.diff","patch_url":"https://github.com/Netflix/karyon/pull/252.patch","issue_url":"https://api.github.com/repos/Netflix/karyon/issues/252","number":252,"state":"open","locked":false,"title":"WIP: Eureka1 integration","user":{"login":"elandau","id":913564,"avatar_url":"https://avatars.githubusercontent.com/u/913564?v=3","gravatar_id":"","url":"https://api.github.com/users/elandau","html_url":"https://github.com/elandau","followers_url":"https://api.github.com/users/elandau/followers","following_url":"https://api.github.com/users/elandau/following{/other_user}","gists_url":"https://api.github.com/users/elandau/gists{/gist_id}","starred_url":"https://api.github.com/users/elandau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elandau/subscriptions","organizations_url":"https://api.github.com/users/elandau/orgs","repos_url":"https://api.github.com/users/elandau/repos","events_url":"https://api.github.com/users/elandau/events{/privacy}","received_events_url":"https://api.github.com/users/elandau/received_events","type":"User","site_admin":false},"body":"First pass at a eureka 1.x client that is,\r\n* Configurable solely via Archaius2\r\n* Integrates with Karyon3 health check.  HealthCheck binding is optional and defaults to up.  An instance will be automatically marked as up once the injector has been created and health check is up.\r\n\r\nTo enable simply add the EurekaModule when setting up Karyon.  ","created_at":"2015-08-06T06:02:45Z","updated_at":"2015-08-07T02:51:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"468912f10a344aae11cda7a280f02b0054e615b2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Netflix/karyon/pulls/252/commits","review_comments_url":"https://api.github.com/repos/Netflix/karyon/pulls/252/comments","review_comment_url":"https://api.github.com/repos/Netflix/karyon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Netflix/karyon/issues/252/comments","statuses_url":"https://api.github.com/repos/Netflix/karyon/statuses/5ae6a9d520171fafd412045a420c7eba02c3213e","head":{"label":"elandau:3.x_eureka","ref":"3.x_eureka","sha":"5ae6a9d520171fafd412045a420c7eba02c3213e","user":{"login":"elandau","id":913564,"avatar_url":"https://avatars.githubusercontent.com/u/913564?v=3","gravatar_id":"","url":"https://api.github.com/users/elandau","html_url":"https://github.com/elandau","followers_url":"https://api.github.com/users/elandau/followers","following_url":"https://api.github.com/users/elandau/following{/other_user}","gists_url":"https://api.github.com/users/elandau/gists{/gist_id}","starred_url":"https://api.github.com/users/elandau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elandau/subscriptions","organizations_url":"https://api.github.com/users/elandau/orgs","repos_url":"https://api.github.com/users/elandau/repos","events_url":"https://api.github.com/users/elandau/events{/privacy}","received_events_url":"https://api.github.com/users/elandau/received_events","type":"User","site_admin":false},"repo":{"id":22766295,"name":"karyon","full_name":"elandau/karyon","owner":{"login":"elandau","id":913564,"avatar_url":"https://avatars.githubusercontent.com/u/913564?v=3","gravatar_id":"","url":"https://api.github.com/users/elandau","html_url":"https://github.com/elandau","followers_url":"https://api.github.com/users/elandau/followers","following_url":"https://api.github.com/users/elandau/following{/other_user}","gists_url":"https://api.github.com/users/elandau/gists{/gist_id}","starred_url":"https://api.github.com/users/elandau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elandau/subscriptions","organizations_url":"https://api.github.com/users/elandau/orgs","repos_url":"https://api.github.com/users/elandau/repos","events_url":"https://api.github.com/users/elandau/events{/privacy}","received_events_url":"https://api.github.com/users/elandau/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/elandau/karyon","description":"The nucleus or the base container for Applications and Services built using the NetflixOSS ecosystem","fork":true,"url":"https://api.github.com/repos/elandau/karyon","forks_url":"https://api.github.com/repos/elandau/karyon/forks","keys_url":"https://api.github.com/repos/elandau/karyon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elandau/karyon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elandau/karyon/teams","hooks_url":"https://api.github.com/repos/elandau/karyon/hooks","issue_events_url":"https://api.github.com/repos/elandau/karyon/issues/events{/number}","events_url":"https://api.github.com/repos/elandau/karyon/events","assignees_url":"https://api.github.com/repos/elandau/karyon/assignees{/user}","branches_url":"https://api.github.com/repos/elandau/karyon/branches{/branch}","tags_url":"https://api.github.com/repos/elandau/karyon/tags","blobs_url":"https://api.github.com/repos/elandau/karyon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elandau/karyon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elandau/karyon/git/refs{/sha}","trees_url":"https://api.github.com/repos/elandau/karyon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elandau/karyon/statuses/{sha}","languages_url":"https://api.github.com/repos/elandau/karyon/languages","stargazers_url":"https://api.github.com/repos/elandau/karyon/stargazers","contributors_url":"https://api.github.com/repos/elandau/karyon/contributors","subscribers_url":"https://api.github.com/repos/elandau/karyon/subscribers","subscription_url":"https://api.github.com/repos/elandau/karyon/subscription","commits_url":"https://api.github.com/repos/elandau/karyon/commits{/sha}","git_commits_url":"https://api.github.com/repos/elandau/karyon/git/commits{/sha}","comments_url":"https://api.github.com/repos/elandau/karyon/comments{/number}","issue_comment_url":"https://api.github.com/repos/elandau/karyon/issues/comments{/number}","contents_url":"https://api.github.com/repos/elandau/karyon/contents/{+path}","compare_url":"https://api.github.com/repos/elandau/karyon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elandau/karyon/merges","archive_url":"https://api.github.com/repos/elandau/karyon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elandau/karyon/downloads","issues_url":"https://api.github.com/repos/elandau/karyon/issues{/number}","pulls_url":"https://api.github.com/repos/elandau/karyon/pulls{/number}","milestones_url":"https://api.github.com/repos/elandau/karyon/milestones{/number}","notifications_url":"https://api.github.com/repos/elandau/karyon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elandau/karyon/labels{/name}","releases_url":"https://api.github.com/repos/elandau/karyon/releases{/id}","created_at":"2014-08-08T17:46:44Z","updated_at":"2015-04-21T21:48:44Z","pushed_at":"2015-08-06T06:29:19Z","git_url":"git://github.com/elandau/karyon.git","ssh_url":"git@github.com:elandau/karyon.git","clone_url":"https://github.com/elandau/karyon.git","svn_url":"https://github.com/elandau/karyon","homepage":null,"size":2350,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Netflix:3.x","ref":"3.x","sha":"868d0c793e00449de9801f875d4cdb3366a7b895","user":{"login":"Netflix","id":913567,"avatar_url":"https://avatars.githubusercontent.com/u/913567?v=3","gravatar_id":"","url":"https://api.github.com/users/Netflix","html_url":"https://github.com/Netflix","followers_url":"https://api.github.com/users/Netflix/followers","following_url":"https://api.github.com/users/Netflix/following{/other_user}","gists_url":"https://api.github.com/users/Netflix/gists{/gist_id}","starred_url":"https://api.github.com/users/Netflix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Netflix/subscriptions","organizations_url":"https://api.github.com/users/Netflix/orgs","repos_url":"https://api.github.com/users/Netflix/repos","events_url":"https://api.github.com/users/Netflix/events{/privacy}","received_events_url":"https://api.github.com/users/Netflix/received_events","type":"Organization","site_admin":false},"repo":{"id":8059194,"name":"karyon","full_name":"Netflix/karyon","owner":{"login":"Netflix","id":913567,"avatar_url":"https://avatars.githubusercontent.com/u/913567?v=3","gravatar_id":"","url":"https://api.github.com/users/Netflix","html_url":"https://github.com/Netflix","followers_url":"https://api.github.com/users/Netflix/followers","following_url":"https://api.github.com/users/Netflix/following{/other_user}","gists_url":"https://api.github.com/users/Netflix/gists{/gist_id}","starred_url":"https://api.github.com/users/Netflix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Netflix/subscriptions","organizations_url":"https://api.github.com/users/Netflix/orgs","repos_url":"https://api.github.com/users/Netflix/repos","events_url":"https://api.github.com/users/Netflix/events{/privacy}","received_events_url":"https://api.github.com/users/Netflix/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Netflix/karyon","description":"The nucleus or the base container for Applications and Services built using the NetflixOSS ecosystem","fork":false,"url":"https://api.github.com/repos/Netflix/karyon","forks_url":"https://api.github.com/repos/Netflix/karyon/forks","keys_url":"https://api.github.com/repos/Netflix/karyon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Netflix/karyon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Netflix/karyon/teams","hooks_url":"https://api.github.com/repos/Netflix/karyon/hooks","issue_events_url":"https://api.github.com/repos/Netflix/karyon/issues/events{/number}","events_url":"https://api.github.com/repos/Netflix/karyon/events","assignees_url":"https://api.github.com/repos/Netflix/karyon/assignees{/user}","branches_url":"https://api.github.com/repos/Netflix/karyon/branches{/branch}","tags_url":"https://api.github.com/repos/Netflix/karyon/tags","blobs_url":"https://api.github.com/repos/Netflix/karyon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Netflix/karyon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Netflix/karyon/git/refs{/sha}","trees_url":"https://api.github.com/repos/Netflix/karyon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Netflix/karyon/statuses/{sha}","languages_url":"https://api.github.com/repos/Netflix/karyon/languages","stargazers_url":"https://api.github.com/repos/Netflix/karyon/stargazers","contributors_url":"https://api.github.com/repos/Netflix/karyon/contributors","subscribers_url":"https://api.github.com/repos/Netflix/karyon/subscribers","subscription_url":"https://api.github.com/repos/Netflix/karyon/subscription","commits_url":"https://api.github.com/repos/Netflix/karyon/commits{/sha}","git_commits_url":"https://api.github.com/repos/Netflix/karyon/git/commits{/sha}","comments_url":"https://api.github.com/repos/Netflix/karyon/comments{/number}","issue_comment_url":"https://api.github.com/repos/Netflix/karyon/issues/comments{/number}","contents_url":"https://api.github.com/repos/Netflix/karyon/contents/{+path}","compare_url":"https://api.github.com/repos/Netflix/karyon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Netflix/karyon/merges","archive_url":"https://api.github.com/repos/Netflix/karyon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Netflix/karyon/downloads","issues_url":"https://api.github.com/repos/Netflix/karyon/issues{/number}","pulls_url":"https://api.github.com/repos/Netflix/karyon/pulls{/number}","milestones_url":"https://api.github.com/repos/Netflix/karyon/milestones{/number}","notifications_url":"https://api.github.com/repos/Netflix/karyon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Netflix/karyon/labels{/name}","releases_url":"https://api.github.com/repos/Netflix/karyon/releases{/id}","created_at":"2013-02-06T20:18:55Z","updated_at":"2015-08-05T19:00:24Z","pushed_at":"2015-08-06T06:29:19Z","git_url":"git://github.com/Netflix/karyon.git","ssh_url":"git@github.com:Netflix/karyon.git","clone_url":"https://github.com/Netflix/karyon.git","svn_url":"https://github.com/Netflix/karyon","homepage":null,"size":5547,"stargazers_count":223,"watchers_count":223,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":105,"mirror_url":null,"open_issues_count":21,"forks":105,"open_issues":21,"watchers":223,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Netflix/karyon/pulls/252"},"html":{"href":"https://github.com/Netflix/karyon/pull/252"},"issue":{"href":"https://api.github.com/repos/Netflix/karyon/issues/252"},"comments":{"href":"https://api.github.com/repos/Netflix/karyon/issues/252/comments"},"review_comments":{"href":"https://api.github.com/repos/Netflix/karyon/pulls/252/comments"},"review_comment":{"href":"https://api.github.com/repos/Netflix/karyon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Netflix/karyon/pulls/252/commits"},"statuses":{"href":"https://api.github.com/repos/Netflix/karyon/statuses/5ae6a9d520171fafd412045a420c7eba02c3213e"}}}}