public class EurekaEventSubscribersFetcher
extends java.lang.Object
implements org.ametiste.scm.coordinator.accessor.EventSubscribersFetcher
EurekaEventSubscribersFetcher implements EventSubscribersFetcher interface and provide functionality
for taking SCM event subscribers from Netflix Eureka Server.
Fetcher use Netflix DiscoveryClient to communicate with Eureka Server.
Fetcher get all registered application from server and filter only those who has specified boolean field with value
true and event receiver url path in metadata section.
This criteria allow us don't bother in naming of application and constructing event receiver endpoint url.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
EVENT_RECEIVER_URL_PATH_FIELD |
static java.lang.String |
SUBSCRIBER_METADATA_FIELD |
| Constructor and Description |
|---|
EurekaEventSubscribersFetcher(com.netflix.discovery.DiscoveryClient discoveryClient)
Create instance of
EurekaEventSubscribersFetcher. |
| Modifier and Type | Method and Description |
|---|---|
java.util.Collection<java.net.URI> |
fetchSubscribers() |
java.util.Collection<java.net.URI> |
fetchSubscribers(java.lang.String pattern)
Fetch subscribers from coordinator that application name match to specified regexp pattern.
|
public static final java.lang.String SUBSCRIBER_METADATA_FIELD
public static final java.lang.String EVENT_RECEIVER_URL_PATH_FIELD
public EurekaEventSubscribersFetcher(com.netflix.discovery.DiscoveryClient discoveryClient)
EurekaEventSubscribersFetcher.discoveryClient - Netflix DiscoveryClient instance to communicate with Eureka Server.public java.util.Collection<java.net.URI> fetchSubscribers()
throws org.ametiste.scm.coordinator.accessor.FetchSubscribersException
fetchSubscribers in interface org.ametiste.scm.coordinator.accessor.EventSubscribersFetcherorg.ametiste.scm.coordinator.accessor.FetchSubscribersExceptionpublic java.util.Collection<java.net.URI> fetchSubscribers(java.lang.String pattern)
throws org.ametiste.scm.coordinator.accessor.FetchSubscribersException
fetchSubscribers in interface org.ametiste.scm.coordinator.accessor.EventSubscribersFetcherpattern - string that contains regular expression for filtering.org.ametiste.scm.coordinator.accessor.FetchSubscribersException