Author |
Message
|
wbimb |
Posted: Mon Feb 20, 2012 2:05 am Post subject: Reading Multiple file |
|
|
 Centurion
Joined: 17 Aug 2006 Posts: 144
|
Hi
I have WebSphere Message Broker V6.1
I need to read 2 files one after another
First file is a.csv After reading this file and processing it have to read another file a.txt
How do i acheive this using single flow
Or if i need another flow, then how do i see to it that file a.csv is read before a.txt Inspite of receiving a.txt first |
|
Back to top |
|
 |
marko.pitkanen |
Posted: Mon Feb 20, 2012 2:36 am Post subject: |
|
|
 Chevalier
Joined: 23 Jul 2008 Posts: 440 Location: Jamsa, Finland
|
|
Back to top |
|
 |
mqjeff |
Posted: Mon Feb 20, 2012 3:47 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
marko.pitkanen |
Posted: Mon Feb 20, 2012 4:00 am Post subject: |
|
|
 Chevalier
Joined: 23 Jul 2008 Posts: 440 Location: Jamsa, Finland
|
Hi mqjeff,
Do you mean that OP should upgrade their broker version so that they could use FileRead node?
--
Marko |
|
Back to top |
|
 |
wbimb |
Posted: Mon Feb 20, 2012 4:03 am Post subject: Reading Multiple file |
|
|
 Centurion
Joined: 17 Aug 2006 Posts: 144
|
Hi
Collector node is used when we have to collect information from different sources.
But here a.csv and a.txt are not connected.
First a.csv needs to be processed and the messages should be placed on queue. After that a.txt needs to be processed and the messages should be placed on same queue.
Even if we receive a.txt first will have to wait for a.csv and process that first.
Also FileRead is there in v 7 and not there in V6.1 |
|
Back to top |
|
 |
kash3338 |
Posted: Mon Feb 20, 2012 4:15 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
Use a Temp queue or DB to acheive this. |
|
Back to top |
|
 |
wbimb |
Posted: Mon Feb 20, 2012 4:25 am Post subject: |
|
|
 Centurion
Joined: 17 Aug 2006 Posts: 144
|
How can i use Temp queue...
at any given time i need to read both the files at the same time and then
process it |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Feb 20, 2012 4:32 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You are trying to design your solution based on how the business process appears to be written, rather than on how the technology allows you to solve it.
Again, yes,
Quote: |
OP should upgrade their broker version so that they could use FileRead node |
. You have a requirement that is enabled in the newer level, therefore you have a requirement that justifies moving to the newer level!
And, because, really, v6.1 is now two active versions behind current.
Collector node will not allow you to wait for a.csv to arrive before you process a.txt. You will construct a flow with TWO file Inputs, one for a.csv and one for a.txt. Collector node will allow you to OUTPUT the contents of a.csv before you OUTPUT the contents of a.txt, but not wait for the arrival of a.csv before you READ a.txt.
The only way to achieve that is with FileRead node. Or your own code that does the same thing as FileRead node, using some kind of node that supports a programming language that has I/O operations, which ESQL *does not have*. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Feb 20, 2012 4:32 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
wbimb wrote: |
How can i use Temp queue...
at any given time i need to read both the files at the same time and then
process it |
Best bet is to use a feeder program that correlates the records and feeds both records as an atomic transaction to the broker...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
wbimb |
Posted: Tue Feb 21, 2012 8:23 pm Post subject: |
|
|
 Centurion
Joined: 17 Aug 2006 Posts: 144
|
Is it possible to have 2 flows
One reads a.csv and processes it. After it is done the processing it will call the second flow which reads a.txt and does the processing
Note: Even if a.txt is received first the flow which reads a.csv should start first
Can this be achieved |
|
Back to top |
|
 |
vishnurajnr |
Posted: Wed Feb 22, 2012 12:26 am Post subject: |
|
|
 Centurion
Joined: 08 Aug 2011 Posts: 134 Location: Trivandrum
|
1.Read the files (both CSV and TXT) using same input.
2.Route it based on file name
3. For TXT--store it in a Queue (temp) or DB.
4.For CSV, finish your processing and after process the TXT from DB or MQGET node. (if it is from DB, delete it after successfully processing) |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Feb 22, 2012 3:27 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
wbimb wrote: |
Is it possible to have 2 flows
One reads a.csv and processes it. After it is done the processing it will call the second flow which reads a.txt and does the processing
Note: Even if a.txt is received first the flow which reads a.csv should start first
Can this be achieved |
YES.
YOU CAN DO EXACTLY THIS USING FILEREAD NODE IN V7.
You cannot do this without a FileRead node in v6.1.
Unless you choose to write a JavaCompute node that does the same thing as a FileRead node. |
|
Back to top |
|
 |
|