我正在使用spring批处理和apache camel,并有以下设置(确实有效):
@Component
public class ActiveMqRoute1 extends RouteBuilder {
@Override
public void configure() throws Exception {
from("activemq:foo")
.tracing()
.id("Foo Queue")
//.process(processor)
.log("Sending \"${body}\" Now - ${headers}")
.to("direct:things")
.to("spring-batch:TestJob2?jobLauncherRef=jobLauncherAsync")
.to("mock:activemq")
;
}
}
以及direct:things queue:
@Consume(value = "direct:things")
public void things(String input) throws Exception {
JobParameters params3 = new JobParametersBuilder()
.addString("JobID", String.valueOf(System.currentTimeMillis()))
.addString("fileName", input)
.toJobParameters();
jobLauncher.run(job21, params3);
}
我的主要问题是启动上述作业的spring批处理行,但是如何在spring批处理作业中访问exchange对象及其数据?
我相信上面的消费者会工作,但我也在传递大型xml文档和250字符的限制将不适用于我通过jobparameters。但这是另一个问题。
暂无答案!
目前还没有任何答案,快来回答吧!