我在一个Spring集成项目中工作,流程很简单。所有的东西,路由器和转换器都是用Java编写的。现在,我必须扩展我的项目,以便能够调用由非java语言编写的转换器,如ruby、python、groovy等。我已经看到了如何在Spring上下文中将这些语言中的非java代码建模为bean。但是,我不确定如何在Spring Integration中调用非java转换器。任何指针或示例/代码都会非常有帮助。
发布于 2013-01-08 23:51:06
看一下spring-integration-scripting模块;例如...
<service-activator input-channel="referencedScriptInput">
<script:script
lang="python"
location="org/springframework/integration/scripting/config/jsr223/Jsr223ServiceActivatorTests.py">
<script:variable name="foo" value="foo"/>
<script:variable name="bar" value="bar"/>
<script:variable name="date" ref="date"/>
</script:script>
</service-activator>和
<transformer input-channel="referencedScriptInput">
<script:script
lang="ruby"
location="org/springframework/integration/scripting/config/jsr223/Jsr223TransformerTests.rb"/>
</transformer>文档在这里...http://static.springsource.org/spring-integration/reference/html/messaging-endpoints-chapter.html#scripting
https://stackoverflow.com/questions/14217598
复制相似问题