Reduced visibility of new classes(for now)
minor polishing
This commit is contained in:
@@ -28,13 +28,13 @@ import org.springframework.http.HttpHeaders;
|
|||||||
* @author Dave Syer
|
* @author Dave Syer
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class SimpleRequestBuilder implements RequestBuilder {
|
class SimpleRequestBuilder implements RequestBuilder {
|
||||||
|
|
||||||
private String baseUrl = "http://${destination}";
|
private String baseUrl = "http://${destination}";
|
||||||
private Map<String, String> headers = new LinkedHashMap<>();
|
private Map<String, String> headers = new LinkedHashMap<>();
|
||||||
private Environment environment;
|
private Environment environment;
|
||||||
|
|
||||||
public SimpleRequestBuilder(Environment environment) {
|
SimpleRequestBuilder(Environment environment) {
|
||||||
this.environment = environment;
|
this.environment = environment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,10 +39,9 @@ import org.springframework.web.reactive.function.client.WebClient;
|
|||||||
@Conditional(SourceActiveCondition.class)
|
@Conditional(SourceActiveCondition.class)
|
||||||
@EnableConfigurationProperties(SupplierProperties.class)
|
@EnableConfigurationProperties(SupplierProperties.class)
|
||||||
@ConditionalOnProperty(prefix = "spring.cloud.function.web.supplier", name = "enabled", matchIfMissing = true)
|
@ConditionalOnProperty(prefix = "spring.cloud.function.web.supplier", name = "enabled", matchIfMissing = true)
|
||||||
public class SupplierAutoConfiguration {
|
class SupplierAutoConfiguration {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@ConditionalOnMissingBean
|
|
||||||
public SupplierExporter sourceForwarder(RequestBuilder requestBuilder,
|
public SupplierExporter sourceForwarder(RequestBuilder requestBuilder,
|
||||||
DestinationResolver destinationResolver, FunctionCatalog catalog,
|
DestinationResolver destinationResolver, FunctionCatalog catalog,
|
||||||
WebClient.Builder builder, SupplierProperties props) {
|
WebClient.Builder builder, SupplierProperties props) {
|
||||||
@@ -51,7 +50,6 @@ public class SupplierAutoConfiguration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@ConditionalOnMissingBean
|
|
||||||
public RequestBuilder simpleRequestBuilder(SupplierProperties props,
|
public RequestBuilder simpleRequestBuilder(SupplierProperties props,
|
||||||
Environment environment) {
|
Environment environment) {
|
||||||
SimpleRequestBuilder builder = new SimpleRequestBuilder(environment);
|
SimpleRequestBuilder builder = new SimpleRequestBuilder(environment);
|
||||||
|
|||||||
@@ -40,19 +40,27 @@ import reactor.core.scheduler.Schedulers;
|
|||||||
* @author Dave Syer
|
* @author Dave Syer
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class SupplierExporter implements SmartLifecycle {
|
class SupplierExporter implements SmartLifecycle {
|
||||||
|
|
||||||
|
private final FunctionCatalog catalog;
|
||||||
|
|
||||||
|
private final WebClient client;
|
||||||
|
|
||||||
|
private final DestinationResolver destinationResolver;
|
||||||
|
|
||||||
|
private final RequestBuilder requestBuilder;
|
||||||
|
|
||||||
|
private final String supplier;
|
||||||
|
|
||||||
private FunctionCatalog catalog;
|
|
||||||
private WebClient client;
|
|
||||||
private volatile boolean running;
|
private volatile boolean running;
|
||||||
private volatile boolean ok = true;
|
|
||||||
private boolean autoStartup = true;
|
|
||||||
private boolean debug = true;
|
|
||||||
private String supplier;
|
|
||||||
private volatile Disposable subscription;
|
|
||||||
|
|
||||||
private DestinationResolver destinationResolver;
|
private volatile boolean ok = true;
|
||||||
private RequestBuilder requestBuilder;
|
|
||||||
|
private boolean autoStartup = true;
|
||||||
|
|
||||||
|
private boolean debug = true;
|
||||||
|
|
||||||
|
private volatile Disposable subscription;
|
||||||
|
|
||||||
public SupplierExporter(RequestBuilder requestBuilder,
|
public SupplierExporter(RequestBuilder requestBuilder,
|
||||||
DestinationResolver destinationResolver, FunctionCatalog catalog,
|
DestinationResolver destinationResolver, FunctionCatalog catalog,
|
||||||
@@ -68,7 +76,6 @@ public class SupplierExporter implements SmartLifecycle {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void start() {
|
public void start() {
|
||||||
|
|
||||||
if (this.running) {
|
if (this.running) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user