如何从任务传递响应:在spring-intgeration中安排到某个频道?
<task:scheduled-tasks>
<task:scheduled ref="loadFruits" method="loadFruits" cron="0/5 * * * * *"/>
</task:scheduled-tasks>
<bean id="loadFruits" class="com.data.taskschedulers.LoadFruits"/>
<int:channel id="outboundComplexChannel"/>
Run Code Online (Sandbox Code Playgroud)
现在,我可以将有关如何读取loadFruits方法的返回响应读取到通道outboundComplexChannel
如果有任何方法,请提供
谢谢
我是新来的流口水,请帮助我了解,如果我更新对象后,我打电话火的所有规则,将其启动时机的规则,因为它在Drools的文件呢?
喜欢
rule "Hello World"
no-loop true
when
message:Message (type=='Hello')
then
modify(message){
setType("Hi")//Fires other rule below
}
message.setMsgtext("Msg: Hello World, Drools");
System.out.println("Hello World, Drools!");
end
rule "Hi World"
when
message:Message (type=='Hi')
then
modify(message){
setType("Hello")
}
System.out.println("Hi World, Drools!");
end
Run Code Online (Sandbox Code Playgroud)
而在JAVA代码中,
Message msg = new Message();
msg.setType("Hello");
//sessionObject = rbase.newStatefulSession();
sessionObject.insert(msg);
sessionobject.fireAllrules();
msg.setType("Hi"); //Here can it fire the rule? for me its not doing it
Run Code Online (Sandbox Code Playgroud)
如果它没有触发,那么drool引擎会将一个msg作为与Java运行时对象完全不同的会话对象,因此它不受影响.如果它不是背后的概念,请帮助我理解
谢谢Chakri