Informatica Java 转换为实时 MQ 计划中的每个 MQ 消息生成输出文件
Informatica Java transformation to generate output file for each MQ message in Realtime MQ schedule
我正在尝试生成平面文件,因为输出包含实时配置为 运行 的 MQ 消息数据。在 Informatica PowerCenter Java 转换中需要有关 Java 代码配置的帮助。
Source 是 MQ 消息,Target 是 Flatfile。计划是 MQ Realtime,具有 MQSeries 消息的破坏性读取选项和配置的恢复策略。
我正在尝试以下代码,但未生成输出。
Writer writer = null;
filename_1 = o_File_Name;
try {
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(o_File_Name), "utf-8"));
writer.write(MESSAGE_DATA);
} catch (Exception ex) {
// Report
} finally
{
try {writer.close();
} catch (Exception e)
{/*ignore*/}
}
每个 M.Q。消息它应该生成一个单独的输出文件,其中包含消息数据。
Configure below code in Java transformation in "Java Code" tab in "On Input Row" box.
Writer writer = null;
//just writing out the filename here so that you can write to your target for reconciling
filename1 = o_File_Name;
try {
writer = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream(o_File_Name), "utf-8"));
writer.write(MESSAGE_DATA);
} catch (Exception ex) {
// Report
} finally {
try {writer.close();} catch (Exception e) {/*ignore*/}
}
under Import Packages table - add below packages.
import java.io.Writer;
import java.io.BufferedWriter;
import java.io.OutputStreamWriter;
import java.io.FileOutputStream;
pass MESSAGE_DATA as input data which should be content in a file. and pass o_File_Name as location of your file -- $$TGTPATH\FLATFILES\xyz.txt
我正在尝试生成平面文件,因为输出包含实时配置为 运行 的 MQ 消息数据。在 Informatica PowerCenter Java 转换中需要有关 Java 代码配置的帮助。 Source 是 MQ 消息,Target 是 Flatfile。计划是 MQ Realtime,具有 MQSeries 消息的破坏性读取选项和配置的恢复策略。
我正在尝试以下代码,但未生成输出。
Writer writer = null;
filename_1 = o_File_Name;
try {
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(o_File_Name), "utf-8"));
writer.write(MESSAGE_DATA);
} catch (Exception ex) {
// Report
} finally
{
try {writer.close();
} catch (Exception e)
{/*ignore*/}
}
每个 M.Q。消息它应该生成一个单独的输出文件,其中包含消息数据。
Configure below code in Java transformation in "Java Code" tab in "On Input Row" box.
Writer writer = null;
//just writing out the filename here so that you can write to your target for reconciling
filename1 = o_File_Name;
try {
writer = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream(o_File_Name), "utf-8"));
writer.write(MESSAGE_DATA);
} catch (Exception ex) {
// Report
} finally {
try {writer.close();} catch (Exception e) {/*ignore*/}
}
under Import Packages table - add below packages.
import java.io.Writer;
import java.io.BufferedWriter;
import java.io.OutputStreamWriter;
import java.io.FileOutputStream;
pass MESSAGE_DATA as input data which should be content in a file. and pass o_File_Name as location of your file -- $$TGTPATH\FLATFILES\xyz.txt