|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
File processing for FILEOUTPUT NODE |
« View previous topic :: View next topic » |
Author |
Message
|
satms |
Posted: Tue Mar 21, 2017 8:33 am Post subject: File processing for FILEOUTPUT NODE |
|
|
Newbie
Joined: 15 Mar 2017 Posts: 1
|
Hello,
I 've been working on BLOB Message to process the data using the FILENODE, Each file will have only 2 record, Header and Body content.
Eg: i have 20 files in Input folder i want to create 2 different output like 10 records in one file and other 10 in other files.
Tried with time stamp but creating 20 multiple files.
Message Flow
File_Input>Compute>File_Output.
Below are the code.
-- propagate the End of Data message to the Finish File terminal
IF messageCount = 10 THEN
SET messageCount = 0;
SET OutputLocalEnvironment.Destination.File.Directory = 'C:\Testing\output\';
SET OutputLocalEnvironment.Destination.File.Name = CurrentTimeStamp ||'_output.txt';
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
How Can i implement this,,?? Like i need to create the files with run time
Please Help me out in solving This, Thanks in advance. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Mar 21, 2017 8:42 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
You face a number of issues:
- it's highly unlikely you're going to process all 20 files within the same value of CurrentTimeStamp
- even if you did, each input file counts as a different transaction to the broker so it won't be within the same scope.
Your best chance is choose some less dynamic file name (like the day) and append each of the files to it. How you work out you've processed all the input files so can pass the 2 files you've created to the following processing step will be your next challenge.
Alternatively you could use OS facilities to sort all the files together, read them as a single input file and write out 2 files simultaneously.
Best of all, you could fix this design so you didn't have to tie your code in knots to make it work. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
adubya |
Posted: Tue Mar 21, 2017 8:43 am Post subject: |
|
|
Partisan
Joined: 25 Aug 2011 Posts: 377 Location: GU12, UK
|
Feed the FileInput node data into a collector node which is configured to batch up inputs into, errrr, batches ? Then process that consolidated collection to generate the output files you need. _________________ Independent Middleware Consultant
andy@knownentity.com |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Mar 21, 2017 8:45 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
A very poor idea is to use a separate flow to aggregate files together from one location, and then write out a file with all records where the next flow can read it.
A very good idea is to apply pressure to the sending app to stop using files in the first place. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|