{"action":"created","comment":{"url":"https://api.github.com/repos/AmyAssist/Amy/pulls/comments/213597423","pull_request_review_id":150464568,"id":213597423,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMzU5NzQyMw==","diff_hunk":"@@ -23,122 +23,123 @@\n \n package de.unistuttgart.iaas.amyassist.amy.messagehub;\n \n-import java.util.LinkedList;\n-import java.util.List;\n-import java.util.Map;\n-import java.util.concurrent.BlockingQueue;\n-import java.util.concurrent.ConcurrentHashMap;\n-import java.util.concurrent.LinkedBlockingQueue;\n+import java.util.*;\n+import java.util.Map.Entry;\n+import java.util.function.BiConsumer;\n import java.util.function.Consumer;\n \n import org.slf4j.Logger;\n \n+import de.unistuttgart.iaas.amyassist.amy.core.di.annotation.PostConstruct;\n import de.unistuttgart.iaas.amyassist.amy.core.di.annotation.Reference;\n import de.unistuttgart.iaas.amyassist.amy.core.di.annotation.Service;\n-import de.unistuttgart.iaas.amyassist.amy.core.service.RunnableService;\n+import de.unistuttgart.iaas.amyassist.amy.messagehub.topic.TopicFactory;\n+import de.unistuttgart.iaas.amyassist.amy.messagehub.topic.TopicFilter;\n+import de.unistuttgart.iaas.amyassist.amy.messagehub.topic.TopicName;\n \n /**\n  * The implementation of the MessageHub api interface as Runnable Service\n- * \n+ *\n  * @author Kai Menzel, Leon Kiefer\n  */\n @Service(MessageHub.class)\n-public class MessageHubService implements MessageHub, Runnable, RunnableService {\n-\n+public class MessageHubService implements MessageHub {\n \t@Reference\n \tprivate Logger logger;\n \n-\tprivate Map<String, List<Consumer<String>>> eventListener = new ConcurrentHashMap<>();\n+\t@Reference\n+\tprivate TopicFactory tf;\n \n-\tprivate BlockingQueue<Message<String>> queue = new LinkedBlockingQueue<>();\n+\t@Reference\n+\tprivate MessagingAdapter adapter;\n \n-\tprivate Thread thread;\n+\tprivate Map<UUID, BiConsumer<TopicName, Message>> eventListener = new HashMap<>();\n+\tprivate Map<TopicFilter, List<UUID>> topicListeners = new HashMap<>();\n \n-\t@Override\n-\tpublic void start() {\n-\t\tthis.thread = new Thread(this, \"MessageHub\");\n-\t\tthis.thread.start();\n+\t@PostConstruct\n+\tprivate void init() {\n+\t\tthis.adapter.setCallback(this::messageArrived);","path":"amy-message-hub/src/main/java/de/unistuttgart/iaas/amyassist/amy/messagehub/MessageHubService.java","position":57,"original_position":65,"commit_id":"5b9b588ced7b97e4ae0d6a95e262977d5f0dbbbd","original_commit_id":"9df062c0d177de8159831bab3fcae7b71caf176d","user":{"login":"neumantm","id":27770422,"node_id":"MDQ6VXNlcjI3NzcwNDIy","avatar_url":"https://avatars0.githubusercontent.com/u/27770422?v=4","gravatar_id":"","url":"https://api.github.com/users/neumantm","html_url":"https://github.com/neumantm","followers_url":"https://api.github.com/users/neumantm/followers","following_url":"https://api.github.com/users/neumantm/following{/other_user}","gists_url":"https://api.github.com/users/neumantm/gists{/gist_id}","starred_url":"https://api.github.com/users/neumantm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neumantm/subscriptions","organizations_url":"https://api.github.com/users/neumantm/orgs","repos_url":"https://api.github.com/users/neumantm/repos","events_url":"https://api.github.com/users/neumantm/events{/privacy}","received_events_url":"https://api.github.com/users/neumantm/received_events","type":"User","site_admin":false},"body":"fixed","created_at":"2018-08-29T08:57:57Z","updated_at":"2018-08-29T08:57:58Z","html_url":"https://github.com/AmyAssist/Amy/pull/358#discussion_r213597423","pull_request_url":"https://api.github.com/repos/AmyAssist/Amy/pulls/358","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/AmyAssist/Amy/pulls/comments/213597423"},"html":{"href":"https://github.com/AmyAssist/Amy/pull/358#discussion_r213597423"},"pull_request":{"href":"https://api.github.com/repos/AmyAssist/Amy/pulls/358"}},"in_reply_to_id":213208991},"pull_request":{"url":"https://api.github.com/repos/AmyAssist/Amy/pulls/358","id":209901097,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5OTAxMDk3","html_url":"https://github.com/AmyAssist/Amy/pull/358","diff_url":"https://github.com/AmyAssist/Amy/pull/358.diff","patch_url":"https://github.com/AmyAssist/Amy/pull/358.patch","issue_url":"https://api.github.com/repos/AmyAssist/Amy/issues/358","number":358,"state":"open","locked":false,"title":"Mqtt Integration","user":{"login":"neumantm","id":27770422,"node_id":"MDQ6VXNlcjI3NzcwNDIy","avatar_url":"https://avatars0.githubusercontent.com/u/27770422?v=4","gravatar_id":"","url":"https://api.github.com/users/neumantm","html_url":"https://github.com/neumantm","followers_url":"https://api.github.com/users/neumantm/followers","following_url":"https://api.github.com/users/neumantm/following{/other_user}","gists_url":"https://api.github.com/users/neumantm/gists{/gist_id}","starred_url":"https://api.github.com/users/neumantm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neumantm/subscriptions","organizations_url":"https://api.github.com/users/neumantm/orgs","repos_url":"https://api.github.com/users/neumantm/repos","events_url":"https://api.github.com/users/neumantm/events{/privacy}","received_events_url":"https://api.github.com/users/neumantm/received_events","type":"User","site_admin":false},"body":"Adds mqtt integration to the message hub\r\n\r\nCloses #305.\r\n\r\nPull request status:\r\n- [x] Tests added/updated\r\n- [x] > 40 % Coverage (is low level, can't really test some of it)\r\n- [x] Code conventions\r\n- [x] Doku required and added\r\n- [x] Ready for review\r\n","created_at":"2018-08-21T17:31:47Z","updated_at":"2018-08-29T08:57:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"915cb81e155ebfba62aec2d93b2cdcc99b3f8673","assignee":{"login":"neumantm","id":27770422,"node_id":"MDQ6VXNlcjI3NzcwNDIy","avatar_url":"https://avatars0.githubusercontent.com/u/27770422?v=4","gravatar_id":"","url":"https://api.github.com/users/neumantm","html_url":"https://github.com/neumantm","followers_url":"https://api.github.com/users/neumantm/followers","following_url":"https://api.github.com/users/neumantm/following{/other_user}","gists_url":"https://api.github.com/users/neumantm/gists{/gist_id}","starred_url":"https://api.github.com/users/neumantm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neumantm/subscriptions","organizations_url":"https://api.github.com/users/neumantm/orgs","repos_url":"https://api.github.com/users/neumantm/repos","events_url":"https://api.github.com/users/neumantm/events{/privacy}","received_events_url":"https://api.github.com/users/neumantm/received_events","type":"User","site_admin":false},"assignees":[{"login":"neumantm","id":27770422,"node_id":"MDQ6VXNlcjI3NzcwNDIy","avatar_url":"https://avatars0.githubusercontent.com/u/27770422?v=4","gravatar_id":"","url":"https://api.github.com/users/neumantm","html_url":"https://github.com/neumantm","followers_url":"https://api.github.com/users/neumantm/followers","following_url":"https://api.github.com/users/neumantm/following{/other_user}","gists_url":"https://api.github.com/users/neumantm/gists{/gist_id}","starred_url":"https://api.github.com/users/neumantm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neumantm/subscriptions","organizations_url":"https://api.github.com/users/neumantm/orgs","repos_url":"https://api.github.com/users/neumantm/repos","events_url":"https://api.github.com/users/neumantm/events{/privacy}","received_events_url":"https://api.github.com/users/neumantm/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/AmyAssist/Amy/pulls/358/commits","review_comments_url":"https://api.github.com/repos/AmyAssist/Amy/pulls/358/comments","review_comment_url":"https://api.github.com/repos/AmyAssist/Amy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AmyAssist/Amy/issues/358/comments","statuses_url":"https://api.github.com/repos/AmyAssist/Amy/statuses/5b9b588ced7b97e4ae0d6a95e262977d5f0dbbbd","head":{"label":"AmyAssist:mqtt","ref":"mqtt","sha":"5b9b588ced7b97e4ae0d6a95e262977d5f0dbbbd","user":{"login":"AmyAssist","id":39340355,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5MzQwMzU1","avatar_url":"https://avatars0.githubusercontent.com/u/39340355?v=4","gravatar_id":"","url":"https://api.github.com/users/AmyAssist","html_url":"https://github.com/AmyAssist","followers_url":"https://api.github.com/users/AmyAssist/followers","following_url":"https://api.github.com/users/AmyAssist/following{/other_user}","gists_url":"https://api.github.com/users/AmyAssist/gists{/gist_id}","starred_url":"https://api.github.com/users/AmyAssist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmyAssist/subscriptions","organizations_url":"https://api.github.com/users/AmyAssist/orgs","repos_url":"https://api.github.com/users/AmyAssist/repos","events_url":"https://api.github.com/users/AmyAssist/events{/privacy}","received_events_url":"https://api.github.com/users/AmyAssist/received_events","type":"Organization","site_admin":false},"repo":{"id":134390462,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQzOTA0NjI=","name":"Amy","full_name":"AmyAssist/Amy","owner":{"login":"AmyAssist","id":39340355,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5MzQwMzU1","avatar_url":"https://avatars0.githubusercontent.com/u/39340355?v=4","gravatar_id":"","url":"https://api.github.com/users/AmyAssist","html_url":"https://github.com/AmyAssist","followers_url":"https://api.github.com/users/AmyAssist/followers","following_url":"https://api.github.com/users/AmyAssist/following{/other_user}","gists_url":"https://api.github.com/users/AmyAssist/gists{/gist_id}","starred_url":"https://api.github.com/users/AmyAssist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmyAssist/subscriptions","organizations_url":"https://api.github.com/users/AmyAssist/orgs","repos_url":"https://api.github.com/users/AmyAssist/repos","events_url":"https://api.github.com/users/AmyAssist/events{/privacy}","received_events_url":"https://api.github.com/users/AmyAssist/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AmyAssist/Amy","description":"Personal Assistance System","fork":false,"url":"https://api.github.com/repos/AmyAssist/Amy","forks_url":"https://api.github.com/repos/AmyAssist/Amy/forks","keys_url":"https://api.github.com/repos/AmyAssist/Amy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AmyAssist/Amy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AmyAssist/Amy/teams","hooks_url":"https://api.github.com/repos/AmyAssist/Amy/hooks","issue_events_url":"https://api.github.com/repos/AmyAssist/Amy/issues/events{/number}","events_url":"https://api.github.com/repos/AmyAssist/Amy/events","assignees_url":"https://api.github.com/repos/AmyAssist/Amy/assignees{/user}","branches_url":"https://api.github.com/repos/AmyAssist/Amy/branches{/branch}","tags_url":"https://api.github.com/repos/AmyAssist/Amy/tags","blobs_url":"https://api.github.com/repos/AmyAssist/Amy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AmyAssist/Amy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AmyAssist/Amy/git/refs{/sha}","trees_url":"https://api.github.com/repos/AmyAssist/Amy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AmyAssist/Amy/statuses/{sha}","languages_url":"https://api.github.com/repos/AmyAssist/Amy/languages","stargazers_url":"https://api.github.com/repos/AmyAssist/Amy/stargazers","contributors_url":"https://api.github.com/repos/AmyAssist/Amy/contributors","subscribers_url":"https://api.github.com/repos/AmyAssist/Amy/subscribers","subscription_url":"https://api.github.com/repos/AmyAssist/Amy/subscription","commits_url":"https://api.github.com/repos/AmyAssist/Amy/commits{/sha}","git_commits_url":"https://api.github.com/repos/AmyAssist/Amy/git/commits{/sha}","comments_url":"https://api.github.com/repos/AmyAssist/Amy/comments{/number}","issue_comment_url":"https://api.github.com/repos/AmyAssist/Amy/issues/comments{/number}","contents_url":"https://api.github.com/repos/AmyAssist/Amy/contents/{+path}","compare_url":"https://api.github.com/repos/AmyAssist/Amy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AmyAssist/Amy/merges","archive_url":"https://api.github.com/repos/AmyAssist/Amy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AmyAssist/Amy/downloads","issues_url":"https://api.github.com/repos/AmyAssist/Amy/issues{/number}","pulls_url":"https://api.github.com/repos/AmyAssist/Amy/pulls{/number}","milestones_url":"https://api.github.com/repos/AmyAssist/Amy/milestones{/number}","notifications_url":"https://api.github.com/repos/AmyAssist/Amy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AmyAssist/Amy/labels{/name}","releases_url":"https://api.github.com/repos/AmyAssist/Amy/releases{/id}","deployments_url":"https://api.github.com/repos/AmyAssist/Amy/deployments","created_at":"2018-05-22T09:16:34Z","updated_at":"2018-08-29T08:48:29Z","pushed_at":"2018-08-29T08:56:43Z","git_url":"git://github.com/AmyAssist/Amy.git","ssh_url":"git@github.com:AmyAssist/Amy.git","clone_url":"https://github.com/AmyAssist/Amy.git","svn_url":"https://github.com/AmyAssist/Amy","homepage":null,"size":5319,"stargazers_count":10,"watchers_count":10,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":48,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1,"open_issues":48,"watchers":10,"default_branch":"dev"}},"base":{"label":"AmyAssist:dev","ref":"dev","sha":"c47423d6fe1546aba2bdc7e0c9415a097a8eb344","user":{"login":"AmyAssist","id":39340355,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5MzQwMzU1","avatar_url":"https://avatars0.githubusercontent.com/u/39340355?v=4","gravatar_id":"","url":"https://api.github.com/users/AmyAssist","html_url":"https://github.com/AmyAssist","followers_url":"https://api.github.com/users/AmyAssist/followers","following_url":"https://api.github.com/users/AmyAssist/following{/other_user}","gists_url":"https://api.github.com/users/AmyAssist/gists{/gist_id}","starred_url":"https://api.github.com/users/AmyAssist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmyAssist/subscriptions","organizations_url":"https://api.github.com/users/AmyAssist/orgs","repos_url":"https://api.github.com/users/AmyAssist/repos","events_url":"https://api.github.com/users/AmyAssist/events{/privacy}","received_events_url":"https://api.github.com/users/AmyAssist/received_events","type":"Organization","site_admin":false},"repo":{"id":134390462,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQzOTA0NjI=","name":"Amy","full_name":"AmyAssist/Amy","owner":{"login":"AmyAssist","id":39340355,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5MzQwMzU1","avatar_url":"https://avatars0.githubusercontent.com/u/39340355?v=4","gravatar_id":"","url":"https://api.github.com/users/AmyAssist","html_url":"https://github.com/AmyAssist","followers_url":"https://api.github.com/users/AmyAssist/followers","following_url":"https://api.github.com/users/AmyAssist/following{/other_user}","gists_url":"https://api.github.com/users/AmyAssist/gists{/gist_id}","starred_url":"https://api.github.com/users/AmyAssist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmyAssist/subscriptions","organizations_url":"https://api.github.com/users/AmyAssist/orgs","repos_url":"https://api.github.com/users/AmyAssist/repos","events_url":"https://api.github.com/users/AmyAssist/events{/privacy}","received_events_url":"https://api.github.com/users/AmyAssist/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AmyAssist/Amy","description":"Personal Assistance System","fork":false,"url":"https://api.github.com/repos/AmyAssist/Amy","forks_url":"https://api.github.com/repos/AmyAssist/Amy/forks","keys_url":"https://api.github.com/repos/AmyAssist/Amy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AmyAssist/Amy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AmyAssist/Amy/teams","hooks_url":"https://api.github.com/repos/AmyAssist/Amy/hooks","issue_events_url":"https://api.github.com/repos/AmyAssist/Amy/issues/events{/number}","events_url":"https://api.github.com/repos/AmyAssist/Amy/events","assignees_url":"https://api.github.com/repos/AmyAssist/Amy/assignees{/user}","branches_url":"https://api.github.com/repos/AmyAssist/Amy/branches{/branch}","tags_url":"https://api.github.com/repos/AmyAssist/Amy/tags","blobs_url":"https://api.github.com/repos/AmyAssist/Amy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AmyAssist/Amy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AmyAssist/Amy/git/refs{/sha}","trees_url":"https://api.github.com/repos/AmyAssist/Amy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AmyAssist/Amy/statuses/{sha}","languages_url":"https://api.github.com/repos/AmyAssist/Amy/languages","stargazers_url":"https://api.github.com/repos/AmyAssist/Amy/stargazers","contributors_url":"https://api.github.com/repos/AmyAssist/Amy/contributors","subscribers_url":"https://api.github.com/repos/AmyAssist/Amy/subscribers","subscription_url":"https://api.github.com/repos/AmyAssist/Amy/subscription","commits_url":"https://api.github.com/repos/AmyAssist/Amy/commits{/sha}","git_commits_url":"https://api.github.com/repos/AmyAssist/Amy/git/commits{/sha}","comments_url":"https://api.github.com/repos/AmyAssist/Amy/comments{/number}","issue_comment_url":"https://api.github.com/repos/AmyAssist/Amy/issues/comments{/number}","contents_url":"https://api.github.com/repos/AmyAssist/Amy/contents/{+path}","compare_url":"https://api.github.com/repos/AmyAssist/Amy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AmyAssist/Amy/merges","archive_url":"https://api.github.com/repos/AmyAssist/Amy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AmyAssist/Amy/downloads","issues_url":"https://api.github.com/repos/AmyAssist/Amy/issues{/number}","pulls_url":"https://api.github.com/repos/AmyAssist/Amy/pulls{/number}","milestones_url":"https://api.github.com/repos/AmyAssist/Amy/milestones{/number}","notifications_url":"https://api.github.com/repos/AmyAssist/Amy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AmyAssist/Amy/labels{/name}","releases_url":"https://api.github.com/repos/AmyAssist/Amy/releases{/id}","deployments_url":"https://api.github.com/repos/AmyAssist/Amy/deployments","created_at":"2018-05-22T09:16:34Z","updated_at":"2018-08-29T08:48:29Z","pushed_at":"2018-08-29T08:56:43Z","git_url":"git://github.com/AmyAssist/Amy.git","ssh_url":"git@github.com:AmyAssist/Amy.git","clone_url":"https://github.com/AmyAssist/Amy.git","svn_url":"https://github.com/AmyAssist/Amy","homepage":null,"size":5319,"stargazers_count":10,"watchers_count":10,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":48,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1,"open_issues":48,"watchers":10,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/AmyAssist/Amy/pulls/358"},"html":{"href":"https://github.com/AmyAssist/Amy/pull/358"},"issue":{"href":"https://api.github.com/repos/AmyAssist/Amy/issues/358"},"comments":{"href":"https://api.github.com/repos/AmyAssist/Amy/issues/358/comments"},"review_comments":{"href":"https://api.github.com/repos/AmyAssist/Amy/pulls/358/comments"},"review_comment":{"href":"https://api.github.com/repos/AmyAssist/Amy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AmyAssist/Amy/pulls/358/commits"},"statuses":{"href":"https://api.github.com/repos/AmyAssist/Amy/statuses/5b9b588ced7b97e4ae0d6a95e262977d5f0dbbbd"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"neumantm"}}