Java Code Examples for org.springframework.boot.autoconfigure.condition.ConditionalOnProperty

The following are top voted examples for showing how to use org.springframework.boot.autoconfigure.condition.ConditionalOnProperty. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: myth   File: AmqpConfig.java   View source code 7 votes vote down vote up
@Bean
@ConditionalOnProperty(prefix = "spring.rabbitmq", name = "host")
public SimpleMessageListenerContainer messageContainer() {
    SimpleMessageListenerContainer container =
            new SimpleMessageListenerContainer(connectionFactory);
    container.setQueues(queue());
    container.setExposeListenerChannel(true);
    container.setMaxConcurrentConsumers(2);
    container.setConcurrentConsumers(1);
    //设置确认模式手工确认
    container.setAcknowledgeMode(AcknowledgeMode.MANUAL);
    container.setMessageListener((ChannelAwareMessageListener) (message, channel) -> {
        byte[] messageBody = message.getBody();
        LOGGER.debug("motan 框架接收到的消息");
        //确认消息成功消费
        final Boolean success = mythMqReceiveService.processMessage(messageBody);
        if (success) {
            channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
        }
    });
    return container;
}
 
Example 2
Project: spring-cloud-skipper   File: SkipperServerPlatformConfiguration.java   View source code 6 votes vote down vote up
@Bean
@ConditionalOnProperty(value = "spring.cloud.skipper.server.enableLocalPlatform", matchIfMissing = true)
public Platform localDeployers(LocalPlatformProperties localPlatformProperties) {
	List<Deployer> deployers = new ArrayList<>();
	Map<String, LocalDeployerProperties> localDeployerPropertiesMap = localPlatformProperties.getAccounts();
	if (localDeployerPropertiesMap.isEmpty()) {
		localDeployerPropertiesMap.put("default", new LocalDeployerProperties());
	}
	for (Map.Entry<String, LocalDeployerProperties> entry : localDeployerPropertiesMap
			.entrySet()) {
		LocalAppDeployer localAppDeployer = new LocalAppDeployer(entry.getValue());
		Deployer deployer = new Deployer(entry.getKey(), "local", localAppDeployer);
		deployer.setDescription(prettyPrintLocalDeployerProperties(entry.getValue()));
		deployers.add(deployer);
	}

	return new Platform("Local", deployers);
}
 
Example 3
Project: cas-5.1.0   File: CasFiltersConfiguration.java   View source code 6 votes vote down vote up
@ConditionalOnProperty(prefix = "cas.httpWebRequest.cors", name = "enabled", havingValue = "true")
@Bean
@RefreshScope
public FilterRegistrationBean casCorsFilter() {
    final HttpWebRequestProperties.Cors cors = casProperties.getHttpWebRequest().getCors();
    final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
    final CorsConfiguration config = new CorsConfiguration();
    config.setAllowCredentials(cors.isEnabled());
    config.setAllowedOrigins(cors.getAllowOrigins());
    config.setAllowedMethods(cors.getAllowMethods());
    config.setAllowedHeaders(cors.getAllowHeaders());
    config.setMaxAge(cors.getMaxAge());
    config.setExposedHeaders(cors.getExposedHeaders());
    source.registerCorsConfiguration("/**", config);
    final FilterRegistrationBean bean = new FilterRegistrationBean(new CorsFilter(source));
    bean.setName("casCorsFilter");
    bean.setAsyncSupported(true);
    bean.setOrder(0);
    return bean;
}
 
Example 4
Project: spring-boot-starter-rocketmq   File: RocketMQAutoConfiguration.java   View source code 6 votes vote down vote up
@Bean
@ConditionalOnClass(DefaultMQProducer.class)
@ConditionalOnMissingBean(DefaultMQProducer.class)
@ConditionalOnProperty(prefix = "spring.rocketmq", value = {"nameServer", "producer.group"})
public DefaultMQProducer mqProducer(RocketMQProperties rocketMQProperties) {

    RocketMQProperties.Producer producerConfig = rocketMQProperties.getProducer();
    String groupName = producerConfig.getGroup();
    Assert.hasText(groupName, "[spring.rocketmq.producer.group] must not be null");

    DefaultMQProducer producer = new DefaultMQProducer(producerConfig.getGroup());
    producer.setNamesrvAddr(rocketMQProperties.getNameServer());
    producer.setSendMsgTimeout(producerConfig.getSendMsgTimeout());
    producer.setRetryTimesWhenSendFailed(producerConfig.getRetryTimesWhenSendFailed());
    producer.setRetryTimesWhenSendAsyncFailed(producerConfig.getRetryTimesWhenSendAsyncFailed());
    producer.setMaxMessageSize(producerConfig.getMaxMessageSize());
    producer.setCompressMsgBodyOverHowmuch(producerConfig.getCompressMsgBodyOverHowmuch());
    producer.setRetryAnotherBrokerWhenNotStoreOK(producerConfig.isRetryAnotherBrokerWhenNotStoreOk());

    return producer;
}
 
Example 5
Project: micrometer   File: MetricsAutoConfiguration.java   View source code 6 votes vote down vote up
/**
 * If AOP is not enabled, scheduled interception will not work.
 */
@Bean
@ConditionalOnClass(name = "org.aspectj.lang.ProceedingJoinPoint")
@ConditionalOnProperty(value = "spring.aop.enabled", havingValue = "true", matchIfMissing = true)
public ScheduledMethodMetrics metricsSchedulingAspect(MeterRegistry registry) {
    return new ScheduledMethodMetrics(registry);
}
 
Example 6
Project: generator-jhipster-storage   File: _StorageConfiguration.java   View source code 6 votes vote down vote up
/**
 * S3 储存客户端
 *
 * @return 客户端
 */
@Bean
@ConditionalOnProperty(value = "bigbug.storage.s3.enable", havingValue = "true")
AmazonS3Client amazonS3Client() {
    ClientConfiguration clientConfig = new ClientConfiguration();
    clientConfig.setProtocol(Protocol.HTTP);

    BasicAWSCredentials basicAWSCredentials =
            new BasicAWSCredentials(
                    storageProperties.getStorage().getS3().getAccessKey(),
                    storageProperties.getStorage().getS3().getSecretKey());

    return (AmazonS3Client) AmazonS3ClientBuilder.standard()
            .withClientConfiguration(clientConfig)
            .withEndpointConfiguration(
                    new AwsClientBuilder.EndpointConfiguration(
                            storageProperties.getStorage().getS3().getEndpoint(), Regions.DEFAULT_REGION.getName()))
            .withCredentials(new AWSStaticCredentialsProvider(basicAWSCredentials))
            .build();
}
 
Example 7
Project: myth   File: AmqpConfig.java   View source code 6 votes vote down vote up
@Bean
@ConditionalOnProperty(prefix = "spring.rabbitmq", name = "host")
public SimpleMessageListenerContainer messageContainer() {
    SimpleMessageListenerContainer container =
            new SimpleMessageListenerContainer(connectionFactory);
    container.setQueues(queue());
    container.setExposeListenerChannel(true);
    container.setMaxConcurrentConsumers(1);
    container.setConcurrentConsumers(1);
    //设置确认模式手工确认
    container.setAcknowledgeMode(AcknowledgeMode.MANUAL);
    container.setMessageListener((ChannelAwareMessageListener) (message, channel) -> {
        byte[] messageBody = message.getBody();
        //确认消息成功消费
        final Boolean success = mythMqReceiveService.processMessage(messageBody);
        if (success) {
            channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
        }
    });
    return container;
}
 
Example 8
Project: myth   File: JmsConfig.java   View source code 6 votes vote down vote up
@Bean(name = "queueListenerContainerFactory")
@ConditionalOnProperty(prefix = "spring.activemq", name = "broker-url")
public JmsListenerContainerFactory<?> jmsListenerContainerQueue(ConnectionFactory activeMQConnectionFactory) {
    DefaultJmsListenerContainerFactory bean = new DefaultJmsListenerContainerFactory();
    bean.setConnectionFactory(activeMQConnectionFactory);
    bean.setPubSubDomain(Boolean.FALSE);
    return bean;
}
 
Example 9
Project: myth   File: AmqpConfig.java   View source code 6 votes vote down vote up
@Bean
@ConditionalOnProperty(prefix = "spring.rabbitmq", name = "host")
public SimpleMessageListenerContainer messageContainer() {
    SimpleMessageListenerContainer container =
            new SimpleMessageListenerContainer(connectionFactory);
    container.setQueues(queue());
    container.setExposeListenerChannel(true);
    container.setMaxConcurrentConsumers(3);
    container.setConcurrentConsumers(1);
    //设置确认模式手工确认
    container.setAcknowledgeMode(AcknowledgeMode.MANUAL);
    container.setMessageListener((ChannelAwareMessageListener) (message, channel) -> {
        byte[] messageBody = message.getBody();
        LogUtil.debug(LOGGER,()->"springcloud  account服务  amqp接收消息");
        //确认消息成功消费
        final Boolean success = mythMqReceiveService.processMessage(messageBody);
        if (success) {
            channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
        }
    });
    return container;
}
 
Example 10
Project: jhipster-microservices-example   File: MetricsConfiguration.java   View source code 5 votes vote down vote up
@Bean
@ConditionalOnProperty("jhipster.logging.spectator-metrics.enabled")
@ExportMetricReader
public SpectatorMetricReader SpectatorMetricReader(Registry registry) {
    log.info("Initializing Spectator Metrics Log reporting");
    return new SpectatorMetricReader(registry);
}
 
Example 11
Project: jhipster-microservices-example   File: MetricsConfiguration.java   View source code 5 votes vote down vote up
@Bean
@ConditionalOnProperty("jhipster.logging.spectator-metrics.enabled")
@ExportMetricReader
public SpectatorMetricReader SpectatorMetricReader(Registry registry) {
    log.info("Initializing Spectator Metrics Log reporting");
    return new SpectatorMetricReader(registry);
}
 
Example 12
Project: jhipster-microservices-example   File: MetricsConfiguration.java   View source code 5 votes vote down vote up
@Bean
@ConditionalOnProperty("jhipster.logging.spectator-metrics.enabled")
@ExportMetricReader
public SpectatorMetricReader SpectatorMetricReader(Registry registry) {
    log.info("Initializing Spectator Metrics Log reporting");
    return new SpectatorMetricReader(registry);
}
 
Example 13
Project: xitikit-blue   File: B2CPolicyAutoConfiguration.java   View source code 5 votes vote down vote up
@Bean("blueKitResetPasswordPolicy")
@ConditionalOnBean(ResetPasswordPolicy.class)
@ConditionalOnProperty(prefix = "blue-kit.b2c.policy.edit-profile", value = {"name", "redirect-url"})
@ConfigurationProperties("blue-kit.b2c.policy.reset-password")
public ResetPasswordPolicy blueKitResetPasswordPolicy(){

    return new ResetPasswordPolicy();
}
 
Example 14
Project: cas-5.1.0   File: CasCoreTicketsSchedulingConfiguration.java   View source code 5 votes vote down vote up
@ConditionalOnMissingBean(name = "ticketRegistryCleanerScheduler")
@ConditionalOnProperty(prefix = "cas.ticket.registry.cleaner", name = "enabled", havingValue = "true", matchIfMissing = true)
@Bean
@Autowired
@RefreshScope
public TicketRegistryCleanerScheduler ticketRegistryCleanerScheduler(@Qualifier("ticketRegistryCleaner") 
                                                                     final TicketRegistryCleaner ticketRegistryCleaner) {
    return new TicketRegistryCleanerScheduler(ticketRegistryCleaner);
}
 
Example 15
Project: spring-boot-multidatasource   File: DataSourceAutoConfiguration.java   View source code 5 votes vote down vote up
@Bean
@ConditionalOnProperty(name = "spring.datasource4.url")
@ConfigurationProperties(prefix = "spring.datasource4")
public DataSourceInitializer dataSourceInitializer4(DataSourceProperties properties,
		ApplicationContext applicationContext) {
	return new DataSourceInitializer(properties, applicationContext, 4);
}
 
Example 16
Project: xm-ms-balance   File: MetricsConfiguration.java   View source code 5 votes vote down vote up
@Bean
@ConditionalOnProperty("jhipster.logging.spectator-metrics.enabled")
@ExportMetricReader
public SpectatorMetricReader spectatorMetricReader(Registry registry) {
    log.info("Initializing Spectator Metrics Log reporting");
    return new SpectatorMetricReader(registry);
}
 
Example 17
Project: spring-cloud-sleuth-amqp-starter   File: SleuthAmqpMessagingAutoConfiguration.java   View source code 5 votes vote down vote up
@Bean
@ConditionalOnProperty(value = "spring.sleuth.amqp.enabled", matchIfMissing = true)
@ConditionalOnMissingBean(AmqpMessagingSpanManager.class)
public AmqpMessagingSpanManager amqpMessagingSpanManager(
    AmqpMessagingSpanInjector amqpMessagingSpanInjector,
    AmqpMessagingSpanExtractor amqpMessagingSpanExtractor,
    Tracer tracer) {
  return new DefaultAmqpMessagingSpanManager(
      amqpMessagingSpanInjector, amqpMessagingSpanExtractor, tracer);
}
 
Example 18
Project: Microservices-with-JHipster-and-Spring-Boot   File: MetricsConfiguration.java   View source code 5 votes vote down vote up
@Bean
@ConditionalOnProperty("jhipster.logging.spectator-metrics.enabled")
@ExportMetricReader
public SpectatorMetricReader SpectatorMetricReader(Registry registry) {
    log.info("Initializing Spectator Metrics Log reporting");
    return new SpectatorMetricReader(registry);
}
 
Example 19
Project: xm-ms-timeline   File: MetricsConfiguration.java   View source code 5 votes vote down vote up
@Bean
@ConditionalOnProperty("jhipster.logging.spectator-metrics.enabled")
@ExportMetricReader
public SpectatorMetricReader SpectatorMetricReader(Registry registry) {
    log.info("Initializing Spectator Metrics Log reporting");
    return new SpectatorMetricReader(registry);
}
 
Example 20
Project: Armory   File: MetricsConfiguration.java   View source code 5 votes vote down vote up
@Bean
@ConditionalOnProperty("jhipster.logging.spectator-metrics.enabled")
@ExportMetricReader
public SpectatorMetricReader SpectatorMetricReader(Registry registry) {
    log.info("Initializing Spectator Metrics Log reporting");
    return new SpectatorMetricReader(registry);
}
 
Example 21
Project: xm-ms-dashboard   File: MetricsConfiguration.java   View source code 5 votes vote down vote up
@Bean
@ConditionalOnProperty("jhipster.logging.spectator-metrics.enabled")
@ExportMetricReader
public SpectatorMetricReader SpectatorMetricReader(Registry registry) {
    log.info("Initializing Spectator Metrics Log reporting");
    return new SpectatorMetricReader(registry);
}
 
Example 22
Project: incubator-servicecomb-saga   File: SagaSpringConfig.java   View source code 5 votes vote down vote up
@ConditionalOnProperty(value = "saga.runningMode", havingValue = "graph", matchIfMissing = true)
@Bean
SagaFactory graphBasedSagaFactory(
    @Value("${saga.thread.count:5}") int numberOfThreads,
    @Value("${saga.retry.delay:3000}") int retryDelay,
    PersistentStore persistentStore,
    FromJsonFormat<Set<String>> childrenExtractor) {

  return new GraphBasedSagaFactory(
      retryDelay,
      persistentStore,
      childrenExtractor,
      Executors.newFixedThreadPool(numberOfThreads, sagaThreadFactory()));
}
 
Example 23
Project: incubator-servicecomb-saga   File: SagaSpringConfig.java   View source code 5 votes vote down vote up
@ConditionalOnProperty(value = "saga.runningMode", havingValue = "actor")
@Bean
SagaFactory actorBasedSagaFactory(
    @Value("${saga.retry.delay:3000}") int retryDelay,
    PersistentStore persistentStore,
    FromJsonFormat<Set<String>> childrenExtractor) {

  return new ActorBasedSagaFactory(
      retryDelay,
      persistentStore,
      childrenExtractor);
}
 
Example 24
Project: Microservices-with-JHipster-and-Spring-Boot   File: MetricsConfiguration.java   View source code 5 votes vote down vote up
@Bean
@ConditionalOnProperty("jhipster.logging.spectator-metrics.enabled")
@ExportMetricReader
public SpectatorMetricReader SpectatorMetricReader(Registry registry) {
    log.info("Initializing Spectator Metrics Log reporting");
    return new SpectatorMetricReader(registry);
}
 
Example 25
Project: xitikit-blue   File: B2CPolicyAutoConfiguration.java   View source code 5 votes vote down vote up
@Bean("blueKitChangeEmailPolicy")
@ConditionalOnBean(ChangeEmailPolicy.class)
@ConditionalOnProperty(prefix = "blue-kit.b2c.policy.change-email", value = {"name", "redirect-url", "template-url"})
@ConfigurationProperties("blue-kit.b2c.policy.change-email")
public ChangeEmailPolicy blueKitChangeEmailPolicy(){

    throw new NotFoundException("'change-email' is not a valid policy (yet) provided by Microsoft's Azure AD B2C. You must manually change the email using the GraphApi instead.");
}
 
Example 26
Project: micrometer   File: MeterBindersConfiguration.java   View source code 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean(LogbackMetrics.class)
@ConditionalOnProperty(value = "management.metrics.binders.logback.enabled", matchIfMissing = true)
@ConditionalOnClass(name = "ch.qos.logback.classic.Logger")
public LogbackMetrics logbackMetrics() {
    return new LogbackMetrics();
}
 
Example 27
Project: xitikit-blue   File: B2CPolicyAutoConfiguration.java   View source code 5 votes vote down vote up
@Bean("blueKitSignUpPolicy")
@ConditionalOnBean(SignUpPolicy.class)
@ConditionalOnProperty(prefix = "blue-kit.b2c.policy.sign-up", value = {"name", "redirect-url"})
@ConfigurationProperties("blue-kit.b2c.policy.sign-up")
public SignUpPolicy blueKitSignUpPolicy(){

    return new SignUpPolicy();
}
 
Example 28
Project: nakadi-producer-spring-boot-starter   File: NakadiProducerAutoConfiguration.java   View source code 5 votes vote down vote up
@Bean(destroyMethod = "stop")
@ConditionalOnProperty({ "nakadi-producer.access-token-uri", "nakadi-producer.access-token-scopes" })
@ConditionalOnMissingBean(AccessTokenProvider.class)
public StupsTokenComponent accessTokenProvider(
        @Value("${nakadi-producer.access-token-uri}") URI accessTokenUri,
        @Value("${nakadi-producer.access-token-scopes}") String[] accessTokenScopes) {
    return new StupsTokenComponent(accessTokenUri, Arrays.asList(accessTokenScopes));
}
 
Example 29
Project: sentry   File: WebConfigurer.java   View source code 5 votes vote down vote up
@Bean
@ConditionalOnProperty(name = "jhipster.cors.allowed-origins")
public CorsFilter corsFilter() {
    log.debug("Registering CORS filter");
    UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
    CorsConfiguration config = jHipsterProperties.getCors();
    source.registerCorsConfiguration("/api/**", config);
    source.registerCorsConfiguration("/v2/api-docs", config);
    source.registerCorsConfiguration("/oauth/**", config);
    return new CorsFilter(source);
}
 
Example 30
Project: xitikit-blue   File: B2CPolicyAutoConfiguration.java   View source code 5 votes vote down vote up
@Bean("blueKitSignOutPolicy")
@ConditionalOnBean(SignOutPolicy.class)
@ConditionalOnProperty(prefix = "blue-kit.b2c.policy.sign-out")
@ConfigurationProperties("blue-kit.b2c.policy.sign-out")
public SignOutPolicy blueKitSignOutPolicy(){

    return new SignOutPolicy();
}
 
Example 31
Project: devoxxus-jhipster-microservices-demo   File: MetricsConfiguration.java   View source code 5 votes vote down vote up
@Bean
@ConditionalOnProperty("jhipster.logging.spectator-metrics.enabled")
@ExportMetricReader
public SpectatorMetricReader SpectatorMetricReader(Registry registry) {
    log.info("Initializing Spectator Metrics Log reporting");
    return new SpectatorMetricReader(registry);
}
 
Example 32
Project: druid-spring-boot   File: DruidAutoConfiguration.java   View source code 5 votes vote down vote up
@Bean
@ConditionalOnProperty(prefix = DRUID_WALL_FILTER_PREFIX, name = "enabled", havingValue = "true")
@ConfigurationProperties(DRUID_WALL_FILTER_PREFIX)
public WallFilter wallFilter(WallConfig wallConfig) {
    log.debug("druid wall-filter init...");
    WallFilter filter = new WallFilter();
    filter.setConfig(wallConfig);
    return filter;
}
 
Example 33
Project: druid-spring-boot   File: DruidAutoConfiguration.java   View source code 5 votes vote down vote up
@Bean
@ConditionalOnProperty(prefix = DRUID_SLF4J_FILTER_PREFIX, name = "enabled", havingValue = "true")
@ConfigurationProperties(DRUID_SLF4J_FILTER_PREFIX)
public Slf4jLogFilter slf4jLogFilter() {
    log.debug("druid slf4j-filter init...");
    return new Slf4jLogFilter();
}
 
Example 34
Project: druid-spring-boot   File: DruidAutoConfiguration.java   View source code 5 votes vote down vote up
@Bean
@ConditionalOnProperty(prefix = DRUID_COMMONS_LOG_FILTER_PREFIX, name = "enabled", havingValue = "true")
@ConfigurationProperties(DRUID_COMMONS_LOG_FILTER_PREFIX)
public CommonsLogFilter commonsLogFilter() {
    log.debug("druid commons-log-filter init...");
    return new CommonsLogFilter();
}
 
Example 35
Project: flowing-retail   File: CamundaJobExecutorConfiguration.java   View source code 5 votes vote down vote up
@Bean
  @ConditionalOnProperty(prefix = "camunda.bpm.job-execution", name = "enabled", havingValue = "true", matchIfMissing = true)  
  public static JobExecutor jobExecutor(@Qualifier(JobConfiguration.CAMUNDA_TASK_EXECUTOR_QUALIFIER) final TaskExecutor taskExecutor) {
    final SpringJobExecutor springJobExecutor = new SpringJobExecutor();
    springJobExecutor.setTaskExecutor(taskExecutor);
    springJobExecutor.setRejectedJobsHandler(new CallerRunsRejectedJobsHandler());
    
    springJobExecutor.setWaitTimeInMillis(10);
//    springJobExecutor.setWaitIncreaseFactor(1.0f);
    springJobExecutor.setMaxWait(20);
    
    return springJobExecutor;
  }
 
Example 36
Project: zipkin-sparkstreaming   File: ZipkinFinagleAdjusterAutoConfiguration.java   View source code 5 votes vote down vote up
@Bean
@ConditionalOnProperty(
    value = "zipkin.sparkstreaming.adjuster.finagle.adjust-issue343",
    havingValue = "true"
)
Adjuster finagleIssue343Adjuster() {
  return FinagleIssue343Adjuster.create();
}
 
Example 37
Project: syndesis   File: TwitterVerifierAutoConfiguration.java   View source code 5 votes vote down vote up
@Bean("twitter")
@Scope(ConfigurableBeanFactory.SCOPE_SINGLETON)
@Lazy
@ConditionalOnProperty(prefix = "io.syndesis.connector.twitter.verifier", name = "enabled", matchIfMissing = true)
public Verifier twitterVerifier() {
    return new TwitterVerifier();
}
 
Example 38
Project: cas-security-spring-boot-starter   File: CasSecurityAutoConfiguration.java   View source code 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean(ServiceProperties.class)
@ConditionalOnProperty(value = "security.cas.service.resolution-mode", havingValue = "dynamic")
ServiceProperties laxServiceProperties() {
    LaxServiceProperties serviceProperties = new LaxServiceProperties();
    serviceProperties.setAuthenticateAllArtifacts(true);
    return serviceProperties;
}
 
Example 39
Project: elephant   File: ServerConfiguration.java   View source code 5 votes vote down vote up
@Bean(initMethod="init",destroyMethod="destroy")
@ConditionalOnProperty(prefix = "elephant",value = {"zk-server"})
public ZkClientRegisterCenter zkClientRegisterCenter(@Value("${elephant.zk-server}")String zkServer){
	ZkClientRegisterCenter registerCenter = new ZkClientRegisterCenter();
	registerCenter.setZkAddress(zkServer);
	return registerCenter;
}
 
Example 40
Project: xm-ms-entity   File: MetricsConfiguration.java   View source code 5 votes vote down vote up
@Bean
@ConditionalOnProperty("jhipster.logging.spectator-metrics.enabled")
@ExportMetricReader
public SpectatorMetricReader SpectatorMetricReader(Registry registry) {
    log.info("Initializing Spectator Metrics Log reporting");
    return new SpectatorMetricReader(registry);
}