我正在尝试对一个简单的流程进行单元测试,它检查文件是否存在,然后执行一些其他任务。
集成流程
@Bean
public IntegrationFlow initiateAlarmAck() {
return IntegrationFlows.from("processAckAlarmInputChannel")
.handle((payload, headers) -> {
LOG.info("Received initiate ack alarm request at " + payload);
File watermarkFile = getWatermarkFile();
if(watermarkFile.isFile()){
LOG.info("Watermark File exists");
return true;
}else{
LOG.info("File does not exists");
return false;
}
})
.<Boolean, String>route(p -> fileRouterFlow(p))
.get();
}
File getWatermarkFile(){
return new File(eventWatermarkFile);
}
@Router
public String fileRouterFlow(boolean fileExits){
if(fileExits)
return "fileFoundChannel";
else
return "fileNotFoundChannel";
}
Run Code Online (Sandbox Code Playgroud)
还有另一个集成流,它从中挑选消息fileNotFoundChannel并进行额外的处理。我不想对这部分进行单元测试。如何停止我的测试以不再做进一步的测试并在发布消息后停止fileNotFoundChannel?
@Bean
public IntegrationFlow fileNotFoundFlow() {
return IntegrationFlows.from("fileNotFoundChannel")
.handle((payload, headers) -> …Run Code Online (Sandbox Code Playgroud) 谁能指出我关于使用Liberty嵌入式JMS消息传递提供程序在WLS自由概要文件版本16.0.0.2上设置DLQ的一些参考?我有一个配置有spring jms侦听器的队列,当消息侦听器引发RuntimeException时,在重试几次后,消息应进入处理信件队列。
谢谢。
我正在使用 HTMLConverter 将 html 转换为 PDF 并尝试设置一些边距。
现有代码:
ConverterProperties props = new ConverterProperties();
props.setBaseUri("src/main/resources/xslt");
PdfDocument pdf = new PdfDocument(new PdfWriter(new FileOutputStream(dest)));
pdf.setDefaultPageSize(new PageSize(612F, 792F));
HtmlConverter.convertToPdf( html, pdf, props);
Run Code Online (Sandbox Code Playgroud)
有人可以建议如何增加利润吗?我使用 Document 类来 setMargin 但不确定它如何进入 HTMLConverter 的 ConvertToPdf 方法。