@Bean public PropertyPathEndpoint propertyPathEndpoint(BusProperties busProperties) { return new PropertyPathEndpoint(new CompositePropertyPathNotificationExtractor(this.extractors), busProperties.getId()); }
private boolean isNotFromSelf(final RemoteApplicationEvent event) { return serviceMatcher != null && !serviceMatcher.isFromSelf(event); }
@Bean public ServiceMatcher serviceMatcher(@BusPathMatcher PathMatcher pathMatcher, BusProperties properties, Environment environment) { String[] configNames = environment.getProperty(CLOUD_CONFIG_NAME_PROPERTY, String[].class, new String[] {}); ServiceMatcher serviceMatcher = new ServiceMatcher(pathMatcher, properties.getId(), configNames); return serviceMatcher; }
@Bean @ConditionalOnEnabledEndpoint public RefreshBusEndpoint refreshBusEndpoint(ApplicationContext context, BusProperties bus) { return new RefreshBusEndpoint(context, bus.getId()); } }
@Bean @ConditionalOnEnabledEndpoint public EnvironmentBusEndpoint environmentBusEndpoint( ApplicationContext context, BusProperties bus) { return new EnvironmentBusEndpoint(context, bus.getId()); } }
@ConditionalOnBusEnabled @ConditionalOnClass({ Schema.class, ProtostuffIOUtil.class }) protected static class BusProtoStuffAutoConfiguration { /** * * @return the protostuff io message converter */ @Bean public MessageConverter busProtoBufConverter() { return new BusProtoStuffMessageConverter(); } }
@BusPathMatcher // There is a @Bean of type PathMatcher coming from Spring MVC @ConditionalOnMissingBean(name = BusAutoConfiguration.BUS_PATH_MATCHER_NAME) @Bean(name = BusAutoConfiguration.BUS_PATH_MATCHER_NAME) public PathMatcher busPathMatcher() { return new DefaultBusPathMatcher(new AntPathMatcher(":")); }
public boolean isFromSelf(RemoteApplicationEvent event) { String originService = event.getOriginService(); String serviceId = getServiceId(); return this.matcher.match(originService, serviceId); }
@Override public boolean match(String pattern, String path) { log.debug("In match: " + pattern + ", " + path); if (!delagateMatcher.match(pattern, path)) { return matchMultiProfile(pattern, path); } return true; }
@Bean public ServiceMatcher serviceMatcher(@BusPathMatcher PathMatcher pathMatcher, BusProperties properties, Environment environment) { String[] configNames = environment.getProperty(CLOUD_CONFIG_NAME_PROPERTY, String[].class, new String[] {}); ServiceMatcher serviceMatcher = new ServiceMatcher(pathMatcher, properties.getId(), configNames); return serviceMatcher; }
@Bean @ConditionalOnEnabledEndpoint public RefreshBusEndpoint refreshBusEndpoint(ApplicationContext context, BusProperties bus) { return new RefreshBusEndpoint(context, bus.getId()); } }
public String getApplicationId() { return bus.getId(); }
@ConditionalOnBusEnabled @ConditionalOnClass({ Schema.class, ProtostuffIOUtil.class }) protected static class BusProtoStuffAutoConfiguration { /** * * @return the protostuff io message converter */ @Bean @StreamMessageConverter public MessageConverter busProtoBufConverter() { return new BusProtoStuffMessageConverter(); } }
@EventListener(classes = RemoteApplicationEvent.class) public void acceptLocal(RemoteApplicationEvent event) { if (this.serviceMatcher.isFromSelf(event) && !(event instanceof AckRemoteApplicationEvent)) { this.cloudBusOutboundChannel.send(MessageBuilder.withPayload(event).build()); } }
@BusPathMatcher // There is a @Bean of type PathMatcher coming from Spring MVC @ConditionalOnMissingBean(name = BusAutoConfiguration.BUS_PATH_MATCHER_NAME) @Bean(name = BusAutoConfiguration.BUS_PATH_MATCHER_NAME) public PathMatcher busPathMatcher() { return new DefaultBusPathMatcher(new AntPathMatcher(":")); }
public boolean isFromSelf(RemoteApplicationEvent event) { String originService = event.getOriginService(); String serviceId = getServiceId(); return this.matcher.match(originService, serviceId); }
@Override public boolean match(String pattern, String path) { log.debug("In match: " + pattern + ", " + path); if (!delagateMatcher.match(pattern, path)) { return matchMultiProfile(pattern, path); } return true; }
/** * * @return the protostuff io message converter */ @Bean @ConditionalOnBusEnabled MessageConverter busProtoBufConverter() { return new BusProtoStuffMessageConverter(); } }
@EventListener(classes = RemoteApplicationEvent.class) public void acceptLocal(RemoteApplicationEvent event) { if (this.serviceMatcher.isFromSelf(event) && !(event instanceof AckRemoteApplicationEvent)) { this.cloudBusOutboundChannel.send(MessageBuilder.withPayload(event).build()); } }
/** * * @return the protostuff io message converter */ @Bean @ConditionalOnBusEnabled MessageConverter busProtoBufConverter() { return new BusProtoStuffMessageConverter(); } }