Source:
<code>protected AbstractBeanDefinition parseConsumer(Element element, ParserContext parserContext) { final BeanDefinitionBuilder jpaOutboundChannelAdapterBuilder = BeanDefinitionBuilder.genericBeanDefinition(JpaOutboundGatewayFactoryBean.class); final BeanDefinitionBuilder jpaExecutorBuilder = JpaParserUtils.getJpaExecutorBuilder(element, parserContext); IntegrationNamespaceUtils.setValueIfAttributeDefined(jpaExecutorBuilder, element, "persist-mode"); IntegrationNamespaceUtils.setValueIfAttributeDefined(jpaExecutorBuilder, element, "flush"); IntegrationNamespaceUtils.setValueIfAttributeDefined(jpaExecutorBuilder, element, "flush-size"); <START> IntegrationNamespaceUtils.setValueIfAttributeDefined(jpaExecutorBuilder, element, "clean-on-flush"); <END> IntegrationNamespaceUtils.setValueIfAttributeDefined(jpaExecutorBuilder, element, "parameter-source-factory"); IntegrationNamespaceUtils.setValueIfAttributeDefined(jpaExecutorBuilder, element, "use-payload-as-parameter-source"); final BeanDefinition jpaExecutorBuilderBeanDefinition = jpaExecutorBuilder.getBeanDefinition(); final String channelAdapterId = this.resolveId(element, jpaOutboundChannelAdapterBuilder.getRawBeanDefinition(), parserContext); final String jpaExecutorBeanName = channelAdapterId + ".jpaExecutor"; parserContext.registerBeanComponent(new BeanComponentDefinition(jpaExecutorBuilderBeanDefinition, jpaExecutorBeanName)); jpaOutboundChannelAdapterBuilder.addConstructorArgReference(jpaExecutorBeanName); jpaOutboundChannelAdapterBuilder.addPropertyValue("producesReply", Boolean.FALSE); final Element transactionalElement = DomUtils.getChildElementByTagName(element, "transactional"); if(transactionalElement != null) { BeanDefinition txAdviceDefinition = IntegrationNamespaceUtils.configureTransactionAttributes(transactionalElement); ManagedList<BeanDefinition> adviceChain = new ManagedList<BeanDefinition>(); adviceChain.add(txAdviceDefinition); jpaOutboundChannelAdapterBuilder.addPropertyValue("txAdviceChain", adviceChain); } return jpaOutboundChannelAdapterBuilder.getBeanDefinition(); }</code><technical_language>more explicit, throw error if "clean-on-flush" is "flush" "flush-size" present</technical_language>

Target:
protected AbstractBeanDefinition parseConsumer(Element element, ParserContext parserContext) { final BeanDefinitionBuilder jpaOutboundChannelAdapterBuilder = BeanDefinitionBuilder.genericBeanDefinition(JpaOutboundGatewayFactoryBean.class); final BeanDefinitionBuilder jpaExecutorBuilder = JpaParserUtils.getJpaExecutorBuilder(element, parserContext); IntegrationNamespaceUtils.setValueIfAttributeDefined(jpaExecutorBuilder, element, "persist-mode"); IntegrationNamespaceUtils.setValueIfAttributeDefined(jpaExecutorBuilder, element, "flush"); IntegrationNamespaceUtils.setValueIfAttributeDefined(jpaExecutorBuilder, element, "flush-size"); IntegrationNamespaceUtils.setValueIfAttributeDefined(jpaExecutorBuilder, element, "clear-on-flush"); IntegrationNamespaceUtils.setValueIfAttributeDefined(jpaExecutorBuilder, element, "parameter-source-factory"); IntegrationNamespaceUtils.setValueIfAttributeDefined(jpaExecutorBuilder, element, "use-payload-as-parameter-source"); final BeanDefinition jpaExecutorBuilderBeanDefinition = jpaExecutorBuilder.getBeanDefinition(); final String channelAdapterId = this.resolveId(element, jpaOutboundChannelAdapterBuilder.getRawBeanDefinition(), parserContext); final String jpaExecutorBeanName = channelAdapterId + ".jpaExecutor"; parserContext.registerBeanComponent(new BeanComponentDefinition(jpaExecutorBuilderBeanDefinition, jpaExecutorBeanName)); jpaOutboundChannelAdapterBuilder.addConstructorArgReference(jpaExecutorBeanName); jpaOutboundChannelAdapterBuilder.addPropertyValue("producesReply", Boolean.FALSE); final Element transactionalElement = DomUtils.getChildElementByTagName(element, "transactional"); if(transactionalElement != null) { BeanDefinition txAdviceDefinition = IntegrationNamespaceUtils.configureTransactionAttributes(transactionalElement); ManagedList<BeanDefinition> adviceChain = new ManagedList<BeanDefinition>(); adviceChain.add(txAdviceDefinition); jpaOutboundChannelAdapterBuilder.addPropertyValue("txAdviceChain", adviceChain); } return jpaOutboundChannelAdapterBuilder.getBeanDefinition(); }