Skip to content

Commit 39e9929

Browse files
committed
docs: synced via GitHub Actions
1 parent 91e14a3 commit 39e9929

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

src/dev-guide/batch/batch-task.md

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@
156156
* `file-reader``file-writer`等支持resourceLocator配置,通过它可以定制资源路径到IResource资源对象的映射逻辑。缺省情况下使用ZipResourceLocator,
157157
它自动识别`/a.zip!/entryNameInZip.txt`这种形式,可以从zip或者jar文件中加载指定文件。
158158

159+
## 异步Processor
160+
缺省情况下processor是同步执行,如果`batch.xml`的根节点上配置了`asyncProcessor=true`则表示启用异步处理,要求processor内部必须调用`batchChunkCtx.countDown()`来标记当前processor执行完毕。
161+
通过asyncProcessTimeout可以配置异步执行的等待时间,缺省为10分钟。
162+
159163
## 常见问题
160164

161165
### 1. 数据文件中有两列数据,属性名分别为 a, b。 现在我要将这个文件导入数据库的 T1, T2 表, 属性 a 对应 T1表的字段 c1,属性 b 对应 T2表的字段 c1。 这种场景的映射关系怎么处理?
@@ -184,19 +188,22 @@
184188

185189
```xml
186190

187-
<processor name="process">
188-
<source>
191+
<batch>
189192
...
190-
consume(result1);
191-
consume(result2);
192-
</source>
193-
</processor>
194-
195-
<consumer name="saveResult1">
196-
<filter>
197-
return item.name == 'result1';
198-
</filter>
199-
200-
<file-writer filePath="result.csv"/>
201-
</consumer>
193+
<processor name="process">
194+
<source>
195+
...
196+
consume(result1);
197+
consume(result2);
198+
</source>
199+
</processor>
200+
201+
<consumer name="saveResult1">
202+
<filter>
203+
return item.name == 'result1';
204+
</filter>
205+
206+
<file-writer filePath="result.csv"/>
207+
</consumer>
208+
</batch>
202209
```

0 commit comments

Comments
 (0)