Fixing stream and itegration issus
This commit is contained in:
@@ -33,10 +33,8 @@ import org.springframework.context.Lifecycle;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.integration.dsl.FilterEndpointSpec;
|
||||
import org.springframework.integration.dsl.GenericEndpointSpec;
|
||||
import org.springframework.integration.dsl.IntegrationFlowBuilder;
|
||||
import org.springframework.integration.dsl.IntegrationFlows;
|
||||
import org.springframework.integration.transformer.MessageTransformingHandler;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
@@ -95,19 +93,11 @@ public class StubRunnerIntegrationConfiguration {
|
||||
}
|
||||
})
|
||||
.transform(
|
||||
new StubRunnerIntegrationTransformer(entries.getValue()),
|
||||
new Consumer<GenericEndpointSpec<MessageTransformingHandler>>() {
|
||||
@Override
|
||||
public void accept(
|
||||
GenericEndpointSpec<MessageTransformingHandler> e) {
|
||||
e.id(flowName + ".transformer");
|
||||
}
|
||||
})
|
||||
new StubRunnerIntegrationTransformer(entries.getValue()))
|
||||
.route(new StubRunnerIntegrationRouter(entries.getValue(),
|
||||
beanFactory));
|
||||
beanFactory.initializeBean(builder.get(), flowName);
|
||||
beanFactory.getBean(flowName + ".filter", Lifecycle.class).start();
|
||||
beanFactory.getBean(flowName + ".transformer", Lifecycle.class).start();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import java.util.Map;
|
||||
import org.springframework.cloud.contract.spec.Contract;
|
||||
import org.springframework.cloud.contract.spec.internal.FromFileProperty;
|
||||
import org.springframework.cloud.contract.verifier.util.BodyExtractor;
|
||||
import org.springframework.integration.transformer.GenericTransformer;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageHeaders;
|
||||
import org.springframework.messaging.support.MessageBuilder;
|
||||
@@ -33,8 +32,7 @@ import org.springframework.messaging.support.MessageBuilder;
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
class StubRunnerIntegrationTransformer
|
||||
implements GenericTransformer<Message<?>, Message<?>> {
|
||||
class StubRunnerIntegrationTransformer {
|
||||
|
||||
private final StubRunnerIntegrationMessageSelector selector;
|
||||
|
||||
@@ -46,7 +44,6 @@ class StubRunnerIntegrationTransformer
|
||||
this.selector = new StubRunnerIntegrationMessageSelector(groovyDsls);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Message<?> transform(Message<?> source) {
|
||||
Contract groovyDsl = matchingContract(source);
|
||||
if (groovyDsl == null || groovyDsl.getOutputMessage() == null) {
|
||||
|
||||
@@ -37,17 +37,14 @@ import org.springframework.cloud.contract.stubrunner.BatchStubRunner;
|
||||
import org.springframework.cloud.contract.stubrunner.StubConfiguration;
|
||||
import org.springframework.cloud.contract.stubrunner.messaging.integration.StubRunnerIntegrationConfiguration;
|
||||
import org.springframework.cloud.stream.annotation.EnableBinding;
|
||||
import org.springframework.cloud.stream.binding.BinderAwareChannelResolver;
|
||||
import org.springframework.cloud.stream.config.BindingProperties;
|
||||
import org.springframework.cloud.stream.config.BindingServiceProperties;
|
||||
import org.springframework.context.Lifecycle;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.integration.dsl.FilterEndpointSpec;
|
||||
import org.springframework.integration.dsl.GenericEndpointSpec;
|
||||
import org.springframework.integration.dsl.IntegrationFlowBuilder;
|
||||
import org.springframework.integration.dsl.IntegrationFlows;
|
||||
import org.springframework.integration.transformer.MessageTransformingHandler;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
@@ -130,19 +127,11 @@ public class StubRunnerStreamConfiguration {
|
||||
e.id(flowName + ".filter");
|
||||
}
|
||||
})
|
||||
.transform(new StubRunnerStreamTransformer(entries.getValue()),
|
||||
new Consumer<GenericEndpointSpec<MessageTransformingHandler>>() {
|
||||
@Override
|
||||
public void accept(
|
||||
GenericEndpointSpec<MessageTransformingHandler> e) {
|
||||
e.id(flowName + ".transformer");
|
||||
}
|
||||
})
|
||||
.transform(new StubRunnerStreamTransformer(entries.getValue()))
|
||||
.route(new StubRunnerMessageRouter(entries.getValue(),
|
||||
beanFactory));
|
||||
beanFactory.initializeBean(builder.get(), flowName);
|
||||
beanFactory.getBean(flowName + ".filter", Lifecycle.class).start();
|
||||
beanFactory.getBean(flowName + ".transformer", Lifecycle.class).start();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import java.util.Map;
|
||||
import org.springframework.cloud.contract.spec.Contract;
|
||||
import org.springframework.cloud.contract.spec.internal.FromFileProperty;
|
||||
import org.springframework.cloud.contract.verifier.util.BodyExtractor;
|
||||
import org.springframework.integration.transformer.GenericTransformer;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageHeaders;
|
||||
import org.springframework.messaging.support.MessageBuilder;
|
||||
@@ -33,7 +32,7 @@ import org.springframework.messaging.support.MessageBuilder;
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
class StubRunnerStreamTransformer implements GenericTransformer<Message<?>, Message<?>> {
|
||||
class StubRunnerStreamTransformer {
|
||||
|
||||
private final StubRunnerStreamMessageSelector selector;
|
||||
|
||||
@@ -45,7 +44,6 @@ class StubRunnerStreamTransformer implements GenericTransformer<Message<?>, Mess
|
||||
this.selector = new StubRunnerStreamMessageSelector(groovyDsls);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Message<?> transform(Message<?> source) {
|
||||
Contract groovyDsl = matchingContract(source);
|
||||
if (groovyDsl == null || groovyDsl.getOutputMessage() == null) {
|
||||
|
||||
Reference in New Issue
Block a user