{"action":"created","issue":{"url":"https://api.github.com/repos/Praqma/tracey-broker/issues/35","repository_url":"https://api.github.com/repos/Praqma/tracey-broker","labels_url":"https://api.github.com/repos/Praqma/tracey-broker/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/Praqma/tracey-broker/issues/35/comments","events_url":"https://api.github.com/repos/Praqma/tracey-broker/issues/35/events","html_url":"https://github.com/Praqma/tracey-broker/issues/35","id":188265003,"number":35,"title":"Improved connection handling","user":{"login":"Andrey9kin","id":1671664,"avatar_url":"https://avatars.githubusercontent.com/u/1671664?v=3","gravatar_id":"","url":"https://api.github.com/users/Andrey9kin","html_url":"https://github.com/Andrey9kin","followers_url":"https://api.github.com/users/Andrey9kin/followers","following_url":"https://api.github.com/users/Andrey9kin/following{/other_user}","gists_url":"https://api.github.com/users/Andrey9kin/gists{/gist_id}","starred_url":"https://api.github.com/users/Andrey9kin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Andrey9kin/subscriptions","organizations_url":"https://api.github.com/users/Andrey9kin/orgs","repos_url":"https://api.github.com/users/Andrey9kin/repos","events_url":"https://api.github.com/users/Andrey9kin/events{/privacy}","received_events_url":"https://api.github.com/users/Andrey9kin/received_events","type":"User","site_admin":false},"labels":[{"id":409511683,"url":"https://api.github.com/repos/Praqma/tracey-broker/labels/Prio%201%20-%20must%20have","name":"Prio 1 - must have","color":"e83d0f","default":false},{"id":409511702,"url":"https://api.github.com/repos/Praqma/tracey-broker/labels/Size%201%20-%20small","name":"Size 1 - small","color":"20b4e5","default":false},{"id":409511770,"url":"https://api.github.com/repos/Praqma/tracey-broker/labels/Status%20-%20workable","name":"Status - workable","color":"ededed","default":false}],"state":"open","locked":false,"assignee":{"login":"alexsedova","id":11182640,"avatar_url":"https://avatars.githubusercontent.com/u/11182640?v=3","gravatar_id":"","url":"https://api.github.com/users/alexsedova","html_url":"https://github.com/alexsedova","followers_url":"https://api.github.com/users/alexsedova/followers","following_url":"https://api.github.com/users/alexsedova/following{/other_user}","gists_url":"https://api.github.com/users/alexsedova/gists{/gist_id}","starred_url":"https://api.github.com/users/alexsedova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexsedova/subscriptions","organizations_url":"https://api.github.com/users/alexsedova/orgs","repos_url":"https://api.github.com/users/alexsedova/repos","events_url":"https://api.github.com/users/alexsedova/events{/privacy}","received_events_url":"https://api.github.com/users/alexsedova/received_events","type":"User","site_admin":false},"assignees":[{"login":"alexsedova","id":11182640,"avatar_url":"https://avatars.githubusercontent.com/u/11182640?v=3","gravatar_id":"","url":"https://api.github.com/users/alexsedova","html_url":"https://github.com/alexsedova","followers_url":"https://api.github.com/users/alexsedova/followers","following_url":"https://api.github.com/users/alexsedova/following{/other_user}","gists_url":"https://api.github.com/users/alexsedova/gists{/gist_id}","starred_url":"https://api.github.com/users/alexsedova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexsedova/subscriptions","organizations_url":"https://api.github.com/users/alexsedova/orgs","repos_url":"https://api.github.com/users/alexsedova/repos","events_url":"https://api.github.com/users/alexsedova/events{/privacy}","received_events_url":"https://api.github.com/users/alexsedova/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2016-11-09T14:48:40Z","updated_at":"2016-11-09T15:18:17Z","closed_at":null,"body":"According to Rabbit MQ best practices, we should try to minimize the number of connections (class Connection represents TCP connection to RabbitMQ server) and use a separate channel for every separate thread.\r\n\r\nCurrently, this part is implemented by RabbitMQConnection class where we will create new connection every time we request new channel\r\n\r\n```\r\n    public Channel createChannel() throws IOException, TimeoutException {\r\n        if(channel != null) {\r\n            return channel;\r\n        }\r\n        channel = factory.newConnection().createChannel();\r\n        return channel;\r\n    }\r\n```\r\n\r\nSo the idea is to extend RabbitMQConnection class with a class variable (static variable) connection that will hold only one connection within an application. And modify createChannel function to create channels from existing connection.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Praqma/tracey-broker/issues/comments/259438822","html_url":"https://github.com/Praqma/tracey-broker/issues/35#issuecomment-259438822","issue_url":"https://api.github.com/repos/Praqma/tracey-broker/issues/35","id":259438822,"user":{"login":"Andrey9kin","id":1671664,"avatar_url":"https://avatars.githubusercontent.com/u/1671664?v=3","gravatar_id":"","url":"https://api.github.com/users/Andrey9kin","html_url":"https://github.com/Andrey9kin","followers_url":"https://api.github.com/users/Andrey9kin/followers","following_url":"https://api.github.com/users/Andrey9kin/following{/other_user}","gists_url":"https://api.github.com/users/Andrey9kin/gists{/gist_id}","starred_url":"https://api.github.com/users/Andrey9kin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Andrey9kin/subscriptions","organizations_url":"https://api.github.com/users/Andrey9kin/orgs","repos_url":"https://api.github.com/users/Andrey9kin/repos","events_url":"https://api.github.com/users/Andrey9kin/events{/privacy}","received_events_url":"https://api.github.com/users/Andrey9kin/received_events","type":"User","site_admin":false},"created_at":"2016-11-09T15:18:17Z","updated_at":"2016-11-09T15:18:17Z","body":"@alexsedova so what we can do in the plugin is to have a map that holds channel id instead of consumer tag and then we will close channels via channel id - that will also terminate queues. Which means that we probably need to add one more function to RabbitMQConnection to close channel via channel id\r\n\r\n"}}
{"actor":{"display_login":"Andrey9kin"}}