/** * Returns the given app that is in this instance only, falling back to other regions transparently only * if specified in this client configuration. * * @param appName the application name of the application * @return the application * * @see com.netflix.discovery.shared.LookupService#getApplication(java.lang.String) */ @Override public Application getApplication(String appName) { boolean disableTransparentFallback = serverConfig.disableTransparentFallbackToOtherRegion(); return this.getApplication(appName, !disableTransparentFallback); }
/** * Get all applications in this instance registry, falling back to other regions if allowed in the Eureka config. * * @return the list of all known applications * * @see com.netflix.discovery.shared.LookupService#getApplications() */ public Applications getApplications() { boolean disableTransparentFallback = serverConfig.disableTransparentFallbackToOtherRegion(); if (disableTransparentFallback) { return getApplicationsFromLocalRegionOnly(); } else { return getApplicationsFromAllRemoteRegions(); // Behavior of falling back to remote region can be disabled. } }
boolean disableTransparentFallback = serverConfig.disableTransparentFallbackToOtherRegion();
@Override @Before public void setUp() throws Exception { super.setUp(); // create a new registry that is sync'ed up with the default registry in the AbstractTester, // but disable transparent fetch to the remote for gets EurekaServerConfig serverConfig = spy(new DefaultEurekaServerConfig()); doReturn(true).when(serverConfig).disableTransparentFallbackToOtherRegion(); testRegistry = new PeerAwareInstanceRegistryImpl( serverConfig, new DefaultEurekaClientConfig(), new DefaultServerCodecs(serverConfig), client ); testRegistry.init(serverContext.getPeerEurekaNodes()); testRegistry.syncUp(); }
/** * Returns the given app that is in this instance only, falling back to other regions transparently only * if specified in this client configuration. * * @param appName the application name of the application * @return the application * * @see com.netflix.discovery.shared.LookupService#getApplication(java.lang.String) */ @Override public Application getApplication(String appName) { boolean disableTransparentFallback = serverConfig.disableTransparentFallbackToOtherRegion(); return this.getApplication(appName, !disableTransparentFallback); }
/** * Get all applications in this instance registry, falling back to other regions if allowed in the Eureka config. * * @return the list of all known applications * * @see com.netflix.discovery.shared.LookupService#getApplications() */ public Applications getApplications() { boolean disableTransparentFallback = serverConfig.disableTransparentFallbackToOtherRegion(); if (disableTransparentFallback) { return getApplicationsFromLocalRegionOnly(); } else { return getApplicationsFromAllRemoteRegions(); // Behavior of falling back to remote region can be disabled. } }
boolean disableTransparentFallback = serverConfig.disableTransparentFallbackToOtherRegion();