【发布时间】:2015-06-23 02:55:52
【问题描述】:
我正在尝试将 Python 与 spring-integration 和 jython-standalone-2.7.0 一起使用:
这是我的应用程序上下文:
<int:inbound-channel-adapter id="in" channel="exampleChannel" >
<int:poller fixed-rate="1000" />
<int-script:script lang="python" location="script/message.py" />
</int:inbound-channel-adapter>
<int:channel id="exampleChannel" />
<int-ip:udp-outbound-channel-adapter id="udpOut" channel="exampleChannel" host="192.168.0.1" port="11111" />
这是我的 Python 脚本:
print "Python"
message="python-message"
当我启动应用程序时,我在控制台中看到“Python”。这一定意味着我的脚本是由 spring-integration 启动的,但 udp 中没有发送任何内容。
我在代码中看到org.spring.framework.integration.scripting.js223.AbstractScriptExecutor:
result = scriptEngine.eval(script, new SimpleBindings(variables));
所有 Python 变量都在 Map 变量中,并且 scriptEngine 不包含对 Python 变量的引用。
因此,在org.spring.framework.integration.scripting.js223.PythonScriptExecutor:
scriptEngine.get(returnVariableName);
它返回空值。
这是 Jython、Spring 集成中的问题还是我做错了什么?
【问题讨论】:
-
我不确定问题出在哪里,但我转载了;调查...
标签: python spring-integration jython