File tree 1 file changed +21
-14
lines changed
1 file changed +21
-14
lines changed Original file line number Diff line number Diff line change 156
156
* ` file-reader ` 和` file-writer ` 等支持resourceLocator配置,通过它可以定制资源路径到IResource资源对象的映射逻辑。缺省情况下使用ZipResourceLocator,
157
157
它自动识别` /a.zip!/entryNameInZip.txt ` 这种形式,可以从zip或者jar文件中加载指定文件。
158
158
159
+ ## 异步Processor
160
+ 缺省情况下processor是同步执行,如果` batch.xml ` 的根节点上配置了` asyncProcessor=true ` 则表示启用异步处理,要求processor内部必须调用` batchChunkCtx.countDown() ` 来标记当前processor执行完毕。
161
+ 通过asyncProcessTimeout可以配置异步执行的等待时间,缺省为10分钟。
162
+
159
163
## 常见问题
160
164
161
165
### 1. 数据文件中有两列数据,属性名分别为 a, b。 现在我要将这个文件导入数据库的 T1, T2 表, 属性 a 对应 T1表的字段 c1,属性 b 对应 T2表的字段 c1。 这种场景的映射关系怎么处理?
184
188
185
189
``` xml
186
190
187
- <processor name =" process" >
188
- <source >
191
+ <batch >
189
192
...
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 >
202
209
```
You can’t perform that action at this time.
0 commit comments