I couldn't import java dsl config into XML configuration.
@Configuration
@EnableIntegration
@IntegrationComponentScan
public class JavaApplicationContext {
@MessagingGateway
public interface helloService {
@Gateway(requestChannel = "requestChnl")
public String sayHello(String msg);
}
@Bean
public IntegrationFlow helloIntFlow() {
return IntegrationFlows.from("requestChnl")
.transform(new GenericTransformer<String, String>() {
@Override
public String transform(String source) {
// TODO Auto-generated method stub
return "Hello "+source;
}})
.get();
}
}
Inside XML config, i have <bean id="hellGtwy" class="com.example.JavaApplicationContext" />
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'helloIntFlow' defined in com.example.JavaApplicationContext: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframe work.integration.config.SplitterFactoryBean#6': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: An AbstractReplyPr oducingMessageHandler may only be referenced once (MY_SPLITTER_ID) - use scope="prototype"
I couldnt relate the exception with my code. I have no splitter in the java dsl config.