com.netflix.eureka.EurekaServerConfig Java Examples

The following examples show how to use com.netflix.eureka.EurekaServerConfig. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractDocumentationTests.java    From spring-cloud-netflix with Apache License 2.0 6 votes vote down vote up
@Bean
public EurekaServerContext testEurekaServerContext(ServerCodecs serverCodecs,
		PeerAwareInstanceRegistry registry, PeerEurekaNodes peerEurekaNodes,
		ApplicationInfoManager applicationInfoManager,
		EurekaServerConfig eurekaServerConfig) {
	return new DefaultEurekaServerContext(eurekaServerConfig, serverCodecs,
			registry, peerEurekaNodes, applicationInfoManager) {
		@Override
		public void shutdown() {
			logger.info(
					"Shutting down (except ServoControl and EurekaMonitors)..");
			registry.shutdown();
			peerEurekaNodes.shutdown();
			// ServoControl.shutdown();
			// EurekaMonitors.shutdown();
			logger.info("Shut down");
		}
	};
}
 
Example #2
Source File: EurekaCustomPeerNodesTest.java    From didi-eureka-server with MIT License 5 votes vote down vote up
@Bean
public PeerEurekaNodes myPeerEurekaNodes(PeerAwareInstanceRegistry registry,
		EurekaServerConfig eurekaServerConfig,
		EurekaClientConfig eurekaClientConfig, ServerCodecs serverCodecs,
		ApplicationInfoManager applicationInfoManager) {
	return new CustomEurekaPeerNodes(registry, eurekaServerConfig,
			eurekaClientConfig, serverCodecs, applicationInfoManager);
}
 
Example #3
Source File: EurekaCustomPeerNodesTests.java    From spring-cloud-netflix with Apache License 2.0 5 votes vote down vote up
CustomEurekaPeerNodes(PeerAwareInstanceRegistry registry,
		EurekaServerConfig serverConfig, EurekaClientConfig clientConfig,
		ServerCodecs serverCodecs,
		ApplicationInfoManager applicationInfoManager) {
	super(registry, serverConfig, clientConfig, serverCodecs,
			applicationInfoManager);
}
 
Example #4
Source File: EurekaCustomPeerNodesTests.java    From spring-cloud-netflix with Apache License 2.0 5 votes vote down vote up
@Bean
public PeerEurekaNodes myPeerEurekaNodes(PeerAwareInstanceRegistry registry,
		EurekaServerConfig eurekaServerConfig,
		EurekaClientConfig eurekaClientConfig, ServerCodecs serverCodecs,
		ApplicationInfoManager applicationInfoManager) {
	return new CustomEurekaPeerNodes(registry, eurekaServerConfig,
			eurekaClientConfig, serverCodecs, applicationInfoManager);
}
 
Example #5
Source File: EurekaServerAutoConfiguration.java    From spring-cloud-netflix with Apache License 2.0 5 votes vote down vote up
RefreshablePeerEurekaNodes(final PeerAwareInstanceRegistry registry,
		final EurekaServerConfig serverConfig,
		final EurekaClientConfig clientConfig, final ServerCodecs serverCodecs,
		final ApplicationInfoManager applicationInfoManager,
		final ReplicationClientAdditionalFilters replicationClientAdditionalFilters) {
	super(registry, serverConfig, clientConfig, serverCodecs,
			applicationInfoManager);
	this.replicationClientAdditionalFilters = replicationClientAdditionalFilters;
}
 
Example #6
Source File: EurekaServerAutoConfiguration.java    From spring-cloud-netflix with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public EurekaServerConfig eurekaServerConfig(EurekaClientConfig clientConfig) {
	EurekaServerConfigBean server = new EurekaServerConfigBean();
	if (clientConfig.shouldRegisterWithEureka()) {
		// Set a sensible default if we are supposed to replicate
		server.setRegistrySyncRetries(5);
	}
	return server;
}
 
Example #7
Source File: InstanceRegistry.java    From spring-cloud-netflix with Apache License 2.0 5 votes vote down vote up
public InstanceRegistry(EurekaServerConfig serverConfig,
		EurekaClientConfig clientConfig, ServerCodecs serverCodecs,
		EurekaClient eurekaClient, int expectedNumberOfClientsSendingRenews,
		int defaultOpenForTrafficCount) {
	super(serverConfig, clientConfig, serverCodecs, eurekaClient);

	this.expectedNumberOfClientsSendingRenews = expectedNumberOfClientsSendingRenews;
	this.defaultOpenForTrafficCount = defaultOpenForTrafficCount;
}
 
Example #8
Source File: EurekaServerBootstrap.java    From spring-cloud-netflix with Apache License 2.0 5 votes vote down vote up
public EurekaServerBootstrap(ApplicationInfoManager applicationInfoManager,
		EurekaClientConfig eurekaClientConfig, EurekaServerConfig eurekaServerConfig,
		PeerAwareInstanceRegistry registry, EurekaServerContext serverContext) {
	this.applicationInfoManager = applicationInfoManager;
	this.eurekaClientConfig = eurekaClientConfig;
	this.eurekaServerConfig = eurekaServerConfig;
	this.registry = registry;
	this.serverContext = serverContext;
}
 
Example #9
Source File: EurekaCustomPeerNodesTest.java    From didi-eureka-server with MIT License 5 votes vote down vote up
public CustomEurekaPeerNodes(PeerAwareInstanceRegistry registry,
		EurekaServerConfig serverConfig, EurekaClientConfig clientConfig,
		ServerCodecs serverCodecs,
		ApplicationInfoManager applicationInfoManager) {
	super(registry, serverConfig, clientConfig, serverCodecs,
			applicationInfoManager);
}
 
Example #10
Source File: DiscoveryServerConfig.java    From mPaaS with Apache License 2.0 5 votes vote down vote up
public CustomRefreshablePeerEurekaNodes(
        final PeerAwareInstanceRegistry registry,
        final EurekaServerConfig serverConfig,
        final EurekaClientConfig clientConfig,
        final ServerCodecs serverCodecs,
        final ApplicationInfoManager applicationInfoManager) {
    super(registry, serverConfig, clientConfig, serverCodecs, applicationInfoManager);
}
 
Example #11
Source File: EurekaConfig.java    From api-layer with Eclipse Public License 2.0 5 votes vote down vote up
@Bean
@Primary
public ApimlInstanceRegistry getApimlInstanceRegistry(
    EurekaServerConfig serverConfig,
    EurekaClientConfig clientConfig,
    ServerCodecs serverCodecs,
    EurekaClient eurekaClient,
    InstanceRegistryProperties instanceRegistryProperties,
    ApplicationContext appCntx)
{
    eurekaClient.getApplications(); // force initialization
    return new ApimlInstanceRegistry(serverConfig, clientConfig, serverCodecs, eurekaClient, instanceRegistryProperties,appCntx);
}
 
Example #12
Source File: ApimlInstanceRegistry.java    From api-layer with Eclipse Public License 2.0 5 votes vote down vote up
public ApimlInstanceRegistry(
    EurekaServerConfig serverConfig,
    EurekaClientConfig clientConfig,
    ServerCodecs serverCodecs,
    EurekaClient eurekaClient,
    InstanceRegistryProperties instanceRegistryProperties,
    ApplicationContext appCntx
) {
    super(serverConfig, clientConfig, serverCodecs, eurekaClient,
        instanceRegistryProperties.getExpectedNumberOfClientsSendingRenews(),
        instanceRegistryProperties.getDefaultOpenForTrafficCount()
    );
    this.appCntx = appCntx;
    init();
}
 
Example #13
Source File: RegistrationEventInstanceRegistry.java    From eureka-consul-adapter with MIT License 5 votes vote down vote up
public RegistrationEventInstanceRegistry(EurekaServerConfig serverConfig, EurekaClientConfig clientConfig,
                                         ServerCodecs serverCodecs, EurekaClient eurekaClient,
                                         int expectedNumberOfRenewsPerMin, int defaultOpenForTrafficCount,
                                         ServiceChangeDetector serviceChangeDetector) {
    super(serverConfig, clientConfig, serverCodecs, eurekaClient, expectedNumberOfRenewsPerMin,
            defaultOpenForTrafficCount);
    this.serviceChangeDetector = serviceChangeDetector;
}
 
Example #14
Source File: EurekaServerAutoConfiguration.java    From didi-eureka-server with MIT License 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public EurekaServerConfig eurekaServerConfig(EurekaClientConfig clientConfig) {
	EurekaServerConfigBean server = new EurekaServerConfigBean();
	if (clientConfig.shouldRegisterWithEureka()) {
		// Set a sensible default if we are supposed to replicate
		server.setRegistrySyncRetries(5);
	}
	return server;
}
 
Example #15
Source File: InstanceRegistry.java    From didi-eureka-server with MIT License 5 votes vote down vote up
public InstanceRegistry(EurekaServerConfig serverConfig,
		EurekaClientConfig clientConfig, ServerCodecs serverCodecs,
		EurekaClient eurekaClient, int expectedNumberOfRenewsPerMin,
		int defaultOpenForTrafficCount) {
	super(serverConfig, clientConfig, serverCodecs, eurekaClient);

	this.expectedNumberOfRenewsPerMin = expectedNumberOfRenewsPerMin;
	this.defaultOpenForTrafficCount = defaultOpenForTrafficCount;
}
 
Example #16
Source File: EurekaConsulAdapterConfig.java    From eureka-consul-adapter with MIT License 5 votes vote down vote up
@Bean
@Primary
public RegistrationEventInstanceRegistry registrationEventInstanceRegistry(
        ServerCodecs serverCodecs, EurekaServerConfig eurekaServerConfig, EurekaClient eurekaClient,
        EurekaClientConfig eurekaClientConfig, InstanceRegistryProperties instanceRegistryProperties,
        ServiceChangeDetector serviceChangeDetector) {
    eurekaClient.getApplications(); // force initialization
    return new RegistrationEventInstanceRegistry(eurekaServerConfig, eurekaClientConfig,
            serverCodecs, eurekaClient,
            instanceRegistryProperties.getExpectedNumberOfClientsSendingRenews(),
            instanceRegistryProperties.getDefaultOpenForTrafficCount(), serviceChangeDetector);
}
 
Example #17
Source File: EurekaServerBootstrap.java    From didi-eureka-server with MIT License 5 votes vote down vote up
public EurekaServerBootstrap(ApplicationInfoManager applicationInfoManager,
		EurekaClientConfig eurekaClientConfig, EurekaServerConfig eurekaServerConfig,
		PeerAwareInstanceRegistry registry, EurekaServerContext serverContext) {
	this.applicationInfoManager = applicationInfoManager;
	this.eurekaClientConfig = eurekaClientConfig;
	this.eurekaServerConfig = eurekaServerConfig;
	this.registry = registry;
	this.serverContext = serverContext;
}
 
Example #18
Source File: EurekaServerAutoConfiguration.java    From spring-cloud-netflix with Apache License 2.0 4 votes vote down vote up
private static CodecWrapper getFullJson(EurekaServerConfig serverConfig) {
	CodecWrapper codec = CodecWrappers.getCodec(serverConfig.getJsonCodecName());
	return codec == null ? CodecWrappers.getCodec(JACKSON_JSON.codecName()) : codec;
}
 
Example #19
Source File: EurekaServerStartedEvent.java    From spring-cloud-netflix with Apache License 2.0 4 votes vote down vote up
/**
 * @param eurekaServerConfig {@link EurekaServerConfig} event source
 */
public EurekaServerStartedEvent(EurekaServerConfig eurekaServerConfig) {
	super(eurekaServerConfig);
}
 
Example #20
Source File: EurekaRegistryAvailableEvent.java    From spring-cloud-netflix with Apache License 2.0 4 votes vote down vote up
/**
 * @param eurekaServerConfig {@link EurekaServerConfig} event source
 */
public EurekaRegistryAvailableEvent(EurekaServerConfig eurekaServerConfig) {
	super(eurekaServerConfig);
}
 
Example #21
Source File: EurekaServerAutoConfiguration.java    From spring-cloud-netflix with Apache License 2.0 4 votes vote down vote up
CloudServerCodecs(EurekaServerConfig serverConfig) {
	super(getFullJson(serverConfig),
			CodecWrappers.getCodec(CodecWrappers.JacksonJsonMini.class),
			getFullXml(serverConfig),
			CodecWrappers.getCodec(CodecWrappers.JacksonXmlMini.class));
}
 
Example #22
Source File: EurekaServerAutoConfiguration.java    From spring-cloud-netflix with Apache License 2.0 4 votes vote down vote up
private static CodecWrapper getFullXml(EurekaServerConfig serverConfig) {
	CodecWrapper codec = CodecWrappers.getCodec(serverConfig.getXmlCodecName());
	return codec == null ? CodecWrappers.getCodec(CodecWrappers.XStreamXml.class)
			: codec;
}
 
Example #23
Source File: EurekaServerAutoConfiguration.java    From didi-eureka-server with MIT License 4 votes vote down vote up
private static CodecWrapper getFullXml(EurekaServerConfig serverConfig) {
	CodecWrapper codec = CodecWrappers.getCodec(serverConfig.getXmlCodecName());
	return codec == null ? CodecWrappers.getCodec(CodecWrappers.XStreamXml.class)
			: codec;
}
 
Example #24
Source File: EurekaServerInitializerConfiguration.java    From didi-eureka-server with MIT License 4 votes vote down vote up
private EurekaServerConfig getEurekaServerConfig() {
	return this.eurekaServerConfig;
}
 
Example #25
Source File: EurekaServerInitializerConfiguration.java    From spring-cloud-netflix with Apache License 2.0 4 votes vote down vote up
private EurekaServerConfig getEurekaServerConfig() {
	return this.eurekaServerConfig;
}
 
Example #26
Source File: EurekaServerAutoConfiguration.java    From didi-eureka-server with MIT License 4 votes vote down vote up
private static CodecWrapper getFullJson(EurekaServerConfig serverConfig) {
	CodecWrapper codec = CodecWrappers.getCodec(serverConfig.getJsonCodecName());
	return codec == null ? CodecWrappers.getCodec(JACKSON_JSON.codecName()) : codec;
}
 
Example #27
Source File: EurekaServerStartedEvent.java    From didi-eureka-server with MIT License 4 votes vote down vote up
/**
 * @param eurekaServerConfig
 */
public EurekaServerStartedEvent(EurekaServerConfig eurekaServerConfig) {
	super(eurekaServerConfig);
}
 
Example #28
Source File: EurekaRegistryAvailableEvent.java    From didi-eureka-server with MIT License 4 votes vote down vote up
/**
 * @param eurekaServerConfig
 */
public EurekaRegistryAvailableEvent(EurekaServerConfig eurekaServerConfig) {
	super(eurekaServerConfig);
}
 
Example #29
Source File: EurekaServerAutoConfiguration.java    From didi-eureka-server with MIT License 4 votes vote down vote up
public CloudServerCodecs(EurekaServerConfig serverConfig) {
	super(getFullJson(serverConfig),
			CodecWrappers.getCodec(CodecWrappers.JacksonJsonMini.class),
			getFullXml(serverConfig),
			CodecWrappers.getCodec(CodecWrappers.JacksonXmlMini.class));
}