cod*_*rer 2 java mule talend mule-studio
我曾经使用过Talend Open Integration工作室来创建作业并从IDE运行它或将其导出为可执行jar文件.但我没有广泛使用它.是否可以创建一个包含不同服务器名称和其他变量的外部配置文件,以便在创建Talend作业的可执行jar文件后,我可以更改配置文本文件并选择不同的数据库服务器或端口选项?
我也使用了MuleSoft一点点,所以如果有人知道如何使用MuleSoft做任何建议,将不胜感激.
从您的问题的内容,我将重新描述主题"如何在Talend Open Studio数据集成作业中读取和使用外部属性文件?"
首先......创建属性文件"common.properties".您可以将它放在(例如)/ etc/classpath或c:\ etc\classpath中
属性文件的示例内容
example_property="This is an example property"
Run Code Online (Sandbox Code Playgroud)
在Talend Project中创建公共上下文,并将相同的属性添加到上下文中
创建可重复使用的作业以读取属性并加载它们.我们称之为Read_ Properties.
使用tFileInputDelimited组件读取props文件.它应该使用"="作为行分隔符.
它应该有一个包含两列的模式
key, string
value, string
Run Code Online (Sandbox Code Playgroud)
输出应该转到tBufferOutput
现在......保存那个可重复使用的工作.
创建一个新作业example_calling_job.
该工作应该使用Common上下文.该作业应该有一个prejob步骤,使用tRunJob调用属性作业,将行输出发送到tContextLoad
然后,example_calling_job中的组件可以使用属性读取器作业加载的上下文变量.
运行example_calling_job.tJava组件写出context.example_property值,该值由属性读取器作业加载到上下文变量中.
Starting job example_calling_job at 11:35 02/03/2016.
[statistics] connecting to socket on port 3497
[statistics] connected
This is an example property.
[statistics] disconnected
Job example_calling_job ended at 11:35 02/03/2016. [exit code=0]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3394 次 |
| 最近记录: |