Skip to content

Commit

Permalink
Fixed method names
Browse files Browse the repository at this point in the history
  • Loading branch information
marcingrzejszczak committed Nov 5, 2020
1 parent 4fd1c68 commit c25e3d6
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.cloud.bus.BusProperties;
Expand Down Expand Up @@ -52,6 +55,26 @@ public PropertyPathEndpoint propertyPathEndpoint(BusProperties busProperties) {
busProperties.getId());
}

// TODO: With the current implementation bus can't be disabled
@Bean
@ConditionalOnMissingBean(BusProperties.class)
public PropertyPathEndpoint noBusBeanPropertyPathEndpoint(
@Value("${spring.cloud.bus.id:application}") String id) {
return new PropertyPathEndpoint(new CompositePropertyPathNotificationExtractor(this.extractors), id);
}

}

@Configuration(proxyBeanMethods = false)
@ConditionalOnMissingClass("org.springframework.cloud.bus.BusProperties")
protected static class NoBusPropertyPathConfiguration {

@Bean
public PropertyPathEndpoint noBusPropertyPathEndpoint(@Value("${spring.cloud.bus.id:application}") String id,
@Autowired(required = false) List<PropertyPathNotificationExtractor> extractors) {
return new PropertyPathEndpoint(new CompositePropertyPathNotificationExtractor(extractors), id);
}

}

@Configuration(proxyBeanMethods = false)
Expand Down

0 comments on commit c25e3d6

Please sign in to comment.