{"action":"opened","issue":{"url":"https://api.github.com/repos/vgoldin/camel-hystrix-bridge/issues/2","labels_url":"https://api.github.com/repos/vgoldin/camel-hystrix-bridge/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/vgoldin/camel-hystrix-bridge/issues/2/comments","events_url":"https://api.github.com/repos/vgoldin/camel-hystrix-bridge/issues/2/events","html_url":"https://github.com/vgoldin/camel-hystrix-bridge/issues/2","id":95234987,"number":2,"title":"ProducerTemplate is created on every rest() method","user":{"login":"obuistov","id":13212725,"avatar_url":"https://avatars.githubusercontent.com/u/13212725?v=3","gravatar_id":"","url":"https://api.github.com/users/obuistov","html_url":"https://github.com/obuistov","followers_url":"https://api.github.com/users/obuistov/followers","following_url":"https://api.github.com/users/obuistov/following{/other_user}","gists_url":"https://api.github.com/users/obuistov/gists{/gist_id}","starred_url":"https://api.github.com/users/obuistov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obuistov/subscriptions","organizations_url":"https://api.github.com/users/obuistov/orgs","repos_url":"https://api.github.com/users/obuistov/repos","events_url":"https://api.github.com/users/obuistov/events{/privacy}","received_events_url":"https://api.github.com/users/obuistov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-15T16:26:45Z","updated_at":"2015-07-15T16:26:45Z","closed_at":null,"body":"In HystrixRestRouteBuilder.rest() a ProducerTemplate is created every time the method is invoked:\r\n\r\n```javascript\r\n Exchange response = exchange.getContext().createProducerTemplate().send(uri, exchange);\r\n```\r\n\r\nAccording to this [FAQ](http://camel.apache.org/why-does-camel-use-too-many-threads-with-producertemplate.html) the producer template needs to be created once (by Spring) and then injected to all Processors. \r\n\r\nSee also javadoc for CamelContext.createProducerTemplate()\r\n\r\n\r\n"}}