From b4a30664ee166716bb2e2ea3c28d9c234acef31c Mon Sep 17 00:00:00 2001 From: Mike Heath Date: Fri, 22 Feb 2013 16:17:25 -0700 Subject: [PATCH] Added 'hosts' field to NATS 'router.start' messages so that DEAs can know the router's host for things such as firewall rules. --- lib/router.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/router.rb b/lib/router.rb index a08f846..26db851 100644 --- a/lib/router.rb +++ b/lib/router.rb @@ -147,8 +147,9 @@ # Register ourselves with the system status_config = config['status'] || {} + local_ip = VCAP.local_ip(config['local_route']) VCAP::Component.register(:type => 'Router', - :host => VCAP.local_ip(config['local_route']), + :host => local_ip, :index => config['index'], :config => config, :port => status_config['port'], @@ -172,7 +173,7 @@ VCAP::Component.varz[:tags] = {} @router_id = VCAP.secure_uuid - @hello_message = { :id => @router_id, :version => Router::VERSION }.to_json.freeze + @hello_message = { :id => @router_id, :version => Router::VERSION, :hosts => [local_ip] }.to_json.freeze # This will check on the state of the registered urls, do maintenance, etc.. Router.setup_sweepers