de.codecentric.boot.admin.server.cloud.discovery.ServiceInstanceConverter Java Examples

The following examples show how to use de.codecentric.boot.admin.server.cloud.discovery.ServiceInstanceConverter. 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: AdminServerDiscoveryAutoConfigurationTest.java    From spring-boot-admin with Apache License 2.0 5 votes vote down vote up
@Test
public void customServiceInstanceConverter() {
	this.contextRunner
			.withUserConfiguration(SimpleDiscoveryClientAutoConfiguration.class,
					TestCustomServiceInstanceConverterConfig.class)
			.run((context) -> assertThat(context).getBean(ServiceInstanceConverter.class)
					.isInstanceOf(CustomServiceInstanceConverter.class));
}
 
Example #2
Source File: AdminServerDiscoveryAutoConfigurationTest.java    From Moss with Apache License 2.0 5 votes vote down vote up
@Test
public void customServiceInstanceConverter() {
    contextRunner.withUserConfiguration(SimpleDiscoveryClientAutoConfiguration.class,
        TestCustomServiceInstanceConverterConfig.class
    )
                 .run(context -> assertThat(context).getBean(ServiceInstanceConverter.class)
                                                    .isInstanceOf(CustomServiceInstanceConverter.class));
}
 
Example #3
Source File: MossServerDiscoveryAutoConfiguration.java    From Moss with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public MossInstanceDiscoveryListener instanceDiscoveryListener(ServiceInstanceConverter serviceInstanceConverter,
                                                               InstanceRegistry registry,
                                                               InstanceRepository repository) {
    MossInstanceDiscoveryListener listener = new MossInstanceDiscoveryListener(registry, repository);
    listener.setConverter(serviceInstanceConverter);
    listener.setIgnoredServices(Sets.newHashSet("consul"));
    return listener;
}
 
Example #4
Source File: AdminServerDiscoveryAutoConfiguration.java    From spring-boot-admin with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
@ConfigurationProperties(prefix = "spring.boot.admin.discovery")
public InstanceDiscoveryListener instanceDiscoveryListener(ServiceInstanceConverter serviceInstanceConverter,
		DiscoveryClient discoveryClient, InstanceRegistry registry, InstanceRepository repository) {
	InstanceDiscoveryListener listener = new InstanceDiscoveryListener(discoveryClient, registry, repository);
	listener.setConverter(serviceInstanceConverter);
	return listener;
}
 
Example #5
Source File: MossServerDiscoveryAutoConfiguration.java    From Moss with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public MossInstanceDiscoveryListener instanceDiscoveryListener(ServiceInstanceConverter serviceInstanceConverter,
                                                               InstanceRegistry registry,
                                                               InstanceRepository repository) {
    MossInstanceDiscoveryListener listener = new MossInstanceDiscoveryListener(registry, repository);
    listener.setConverter(serviceInstanceConverter);
    return listener;
}
 
Example #6
Source File: AdminServerDiscoveryAutoConfiguration.java    From Moss with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
@ConfigurationProperties(prefix = "spring.boot.admin.discovery")
public InstanceDiscoveryListener instanceDiscoveryListener(ServiceInstanceConverter serviceInstanceConverter,
                                                           DiscoveryClient discoveryClient,
                                                           InstanceRegistry registry,
                                                           InstanceRepository repository) {
    InstanceDiscoveryListener listener = new InstanceDiscoveryListener(discoveryClient, registry, repository);
    listener.setConverter(serviceInstanceConverter);
    return listener;
}
 
Example #7
Source File: MossServerDiscoveryAutoConfiguration.java    From Moss with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public MossInstanceDiscoveryListener instanceDiscoveryListener(ServiceInstanceConverter serviceInstanceConverter,
                                                           InstanceRegistry registry,
                                                           InstanceRepository repository) {
    MossInstanceDiscoveryListener listener = new MossInstanceDiscoveryListener(registry, repository);
    listener.setConverter(serviceInstanceConverter);
    return listener;
}
 
Example #8
Source File: MossServerDiscoveryAutoConfiguration.java    From Moss with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public MossInstanceDiscoveryListener instanceDiscoveryListener(ServiceInstanceConverter serviceInstanceConverter,
                                                               InstanceRegistry registry,
                                                               InstanceRepository repository,
                                                               ZookeeperDiscoveryClient zookeeperDiscoveryClient) {
    MossInstanceDiscoveryListener listener = new MossInstanceDiscoveryListener(zookeeperDiscoveryClient, registry, repository);
    listener.setConverter(serviceInstanceConverter);
    return listener;
}
 
Example #9
Source File: MossInstanceDiscoveryListener.java    From Moss with Apache License 2.0 4 votes vote down vote up
public void setConverter(ServiceInstanceConverter converter) {
    this.converter = converter;
}
 
Example #10
Source File: AdminServerDiscoveryAutoConfigurationTest.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
@Test
public void kubernetesServiceInstanceConverter() {
	this.contextRunner.withUserConfiguration(KubernetesClientConfig.class).run((context) -> assertThat(context)
			.getBean(ServiceInstanceConverter.class).isInstanceOf(KubernetesServiceInstanceConverter.class));
}
 
Example #11
Source File: AdminServerDiscoveryAutoConfigurationTest.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
@Test
public void eurekaServiceInstanceConverter() {
	this.contextRunner.withUserConfiguration(EurekaClientConfig.class).run((context) -> assertThat(context)
			.getBean(ServiceInstanceConverter.class).isInstanceOf(EurekaServiceInstanceConverter.class));
}
 
Example #12
Source File: AdminServerDiscoveryAutoConfigurationTest.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
@Test
public void defaultServiceInstanceConverter() {
	this.contextRunner.withUserConfiguration(SimpleDiscoveryClientAutoConfiguration.class)
			.run((context) -> assertThat(context.getBean(ServiceInstanceConverter.class))
					.isInstanceOf(DefaultServiceInstanceConverter.class));
}
 
Example #13
Source File: AdminServerDiscoveryAutoConfiguration.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean({ ServiceInstanceConverter.class })
@ConfigurationProperties(prefix = "spring.boot.admin.discovery.converter")
public DefaultServiceInstanceConverter serviceInstanceConverter() {
	return new DefaultServiceInstanceConverter();
}
 
Example #14
Source File: MossServerDiscoveryAutoConfiguration.java    From Moss with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean({ServiceInstanceConverter.class})
public DefaultServiceInstanceConverter serviceInstanceConverter() {
    return new DefaultServiceInstanceConverter();
}
 
Example #15
Source File: MossInstanceDiscoveryListener.java    From Moss with Apache License 2.0 4 votes vote down vote up
public void setConverter(ServiceInstanceConverter converter) {
    this.converter = converter;
}
 
Example #16
Source File: MossServerDiscoveryAutoConfiguration.java    From Moss with Apache License 2.0 4 votes vote down vote up
@ConditionalOnMissingBean({ServiceInstanceConverter.class})
@Bean
public DefaultServiceInstanceConverter serviceInstanceConverter() {
    return new DefaultServiceInstanceConverter();
}
 
Example #17
Source File: MossInstanceDiscoveryListener.java    From Moss with Apache License 2.0 4 votes vote down vote up
public void setConverter(ServiceInstanceConverter converter) {
    this.converter = converter;
}
 
Example #18
Source File: AdminServerDiscoveryAutoConfigurationTest.java    From Moss with Apache License 2.0 4 votes vote down vote up
@Test
public void eurekaServiceInstanceConverter() {
    contextRunner.withUserConfiguration(EurekaClientConfig.class)
                 .run(context -> assertThat(context).getBean(ServiceInstanceConverter.class)
                                                    .isInstanceOf(EurekaServiceInstanceConverter.class));
}
 
Example #19
Source File: AdminServerDiscoveryAutoConfigurationTest.java    From Moss with Apache License 2.0 4 votes vote down vote up
@Test
public void defaultServiceInstanceConverter() {
    contextRunner.withUserConfiguration(SimpleDiscoveryClientAutoConfiguration.class)
                 .run(context -> assertThat(context.getBean(ServiceInstanceConverter.class)).isInstanceOf(
                     DefaultServiceInstanceConverter.class));
}
 
Example #20
Source File: AdminServerDiscoveryAutoConfiguration.java    From Moss with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean({ServiceInstanceConverter.class})
@ConfigurationProperties(prefix = "spring.boot.admin.discovery.converter")
public DefaultServiceInstanceConverter serviceInstanceConverter() {
    return new DefaultServiceInstanceConverter();
}