Search in sources :

Example 1 with DefaultMessageSplitter

use of org.springframework.integration.splitter.DefaultMessageSplitter in project spring-integration-samples by spring-projects.

the class Application method splitter.

@Bean
@ServiceActivator(inputChannel = "splitChannel")
public MessageHandler splitter() {
    DefaultMessageSplitter splitter = new DefaultMessageSplitter();
    splitter.setOutputChannelName("headerEnricherChannel");
    return splitter;
}
Also used : DefaultMessageSplitter(org.springframework.integration.splitter.DefaultMessageSplitter) ServiceActivator(org.springframework.integration.annotation.ServiceActivator) Bean(org.springframework.context.annotation.Bean)

Example 2 with DefaultMessageSplitter

use of org.springframework.integration.splitter.DefaultMessageSplitter in project spring-integration by spring-projects.

the class SplitterFactoryBean method postProcessReplyProducer.

@Override
protected void postProcessReplyProducer(AbstractMessageProducingHandler handler) {
    super.postProcessReplyProducer(handler);
    if (!(handler instanceof AbstractMessageSplitter)) {
        Assert.isNull(this.applySequence, "Cannot set applySequence if the referenced bean is " + "an AbstractReplyProducingMessageHandler, but not an AbstractMessageSplitter");
        Assert.isNull(this.delimiters, "Cannot set delimiters if the referenced bean is not an " + "an AbstractReplyProducingMessageHandler, but not an AbstractMessageSplitter");
    } else {
        AbstractMessageSplitter splitter = (AbstractMessageSplitter) handler;
        if (this.delimiters != null) {
            Assert.isInstanceOf(DefaultMessageSplitter.class, splitter, "The 'delimiters' property is only available for a Splitter definition where no 'ref', " + "'expression', or inner bean has been provided.");
            ((DefaultMessageSplitter) splitter).setDelimiters(this.delimiters);
        }
        if (this.applySequence != null) {
            splitter.setApplySequence(this.applySequence);
        }
    }
}
Also used : DefaultMessageSplitter(org.springframework.integration.splitter.DefaultMessageSplitter) AbstractMessageSplitter(org.springframework.integration.splitter.AbstractMessageSplitter)

Aggregations

DefaultMessageSplitter (org.springframework.integration.splitter.DefaultMessageSplitter)2 Bean (org.springframework.context.annotation.Bean)1 ServiceActivator (org.springframework.integration.annotation.ServiceActivator)1 AbstractMessageSplitter (org.springframework.integration.splitter.AbstractMessageSplitter)1