Spring集成jdbc StoredProcOutboundGateway与DSL
是否有人使用DSL进行了spring集成jdbc StoredProcOutboundGateway配置 没有针对JDBC的Spring集成Java DSL。请随时就此事提出意见 作为解决方法,我们确实没有选择余地,除非使用泛型Spring集成jdbc StoredProcOutboundGateway与DSL,spring,spring-integration,spring-integration-dsl,Spring,Spring Integration,Spring Integration Dsl,是否有人使用DSL进行了spring集成jdbc StoredProcOutboundGateway配置 没有针对JDBC的Spring集成Java DSL。请随时就此事提出意见 作为解决方法,我们确实没有选择余地,除非使用泛型.handle()EIP方法中的StoredProcOutboundGateway类: @Bean public StoredProcExecutor storedProcExecutor() { StoredProcExecutor storedProcExec
.handle()
EIP方法中的StoredProcOutboundGateway
类:
@Bean
public StoredProcExecutor storedProcExecutor() {
StoredProcExecutor storedProcExecutor = new StoredProcExecutor(this.dataSource);
storedProcExecutor.setStoredProcedureName("CREATE_USER_RETURN_ALL");
storedProcExecutor.setIsFunction(true);
...
return storedProcExecutor;
}
...
StoredProcOutboundGateway storedProcOutboundGateway = new StoredProcOutboundGateway(storedProcExecutor());
storedProcOutboundGateway.setExpectSingleResult(true);
storedProcOutboundGateway.setRequiresReply(true);
...
.handle(storedProcOutboundGateway)
感谢@Arthem的快速响应,我们是否有一个示例代码,其中StoredProcOutboundGateway的所有方面都是java代码而不是xml配置。我得到了一个用例,其中存储过程的名称和参数将成为消息头的一部分,我希望利用SpEL。这可以通过java代码(而不是XML)实现。我们有参考或单元测试代码吗?嗯,是的。。。不幸的是,没有。但是,应该清楚的是,这里的一切都取决于
StoredProcessExecutor
。有关更多信息,请参阅其JavaDocs。如果您需要设置存储过程表达式(Expression),您应该查看SpelExpressionParser
:。对于消息中的参数,应使用setProcedureParameters(List)
并使用其表达式。请就此事提出JIRA,以便将样本添加到文档中:谢谢@Arthem,您的指导很有帮助。遵循您提供的文档参考。现在我有了jdbc组件,它的IntegrationFlow工作得很好。太好了!现在是时候接受答案来帮助他人了:另请参阅相关的Jira问题