public class ConsulDiscoveryAgent extends Object implements org.apache.activemq.transport.discovery.DiscoveryAgent
org.apache.activemq.transport.discovery.simple.SimpleDiscoveryAgent but will perform discovery
against Consul every 30 seconds and update available brokers accordingly.
The DiscoveryAgent will also register itself with Consul and perform a TTL check at the time of service lookup.
When the JVM is properly terminated, a shutdown hook will also deregister the broker from Consul.
| Constructor and Description |
|---|
ConsulDiscoveryAgent(URI consulURI) |
| Modifier and Type | Method and Description |
|---|---|
void |
registerService(String name) |
void |
serviceFailed(org.apache.activemq.command.DiscoveryEvent discoveryEvent) |
void |
setDiscoveryListener(org.apache.activemq.transport.discovery.DiscoveryListener listener) |
void |
start() |
void |
stop() |
public ConsulDiscoveryAgent(URI consulURI)
public void setDiscoveryListener(org.apache.activemq.transport.discovery.DiscoveryListener listener)
setDiscoveryListener in interface org.apache.activemq.transport.discovery.DiscoveryAgentpublic void registerService(String name) throws IOException
registerService in interface org.apache.activemq.transport.discovery.DiscoveryAgentIOExceptionpublic void serviceFailed(org.apache.activemq.command.DiscoveryEvent discoveryEvent)
throws IOException
serviceFailed in interface org.apache.activemq.transport.discovery.DiscoveryAgentIOExceptionpublic void start()
throws Exception
start in interface org.apache.activemq.ServiceExceptionCopyright © 2017. All rights reserved.