Author |
Message
|
Dave Ziegler |
Posted: Fri May 09, 2014 12:43 pm Post subject: IIB V9 File Input Node and exception (validation?) handling |
|
|
Centurion
Joined: 15 Apr 2014 Posts: 118
|
Using a File Input node considering each line as a message vs. the entire file as a single message, is it possible to configure it in such a way that either:
a) If the entire file isn't valid, don't process any distinct line item messages, or
b) If a bad line is hit, skip it, and pick up processing at the next valid record (throw away bad lines/messages)
I've been trying various combinations on Parser Options, Records and Elements, Validation, and Transactions, but haven't hit one yet that appears to do what I want. Maybe I just can't do this all with one node!
(Note: I am using DFDL and this is a fixed-length file, each line terminates with %NL;) |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri May 09, 2014 1:24 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You have the possibility to use 2 different messages in your model.
A) message one => one line indiscriminate of contents
b) message two => a choice of formats as described by the line content...
Use message one and propagate with a try Catch
Down the propagate path parse again with message two...
Hope it helps  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Dave Ziegler |
Posted: Fri May 09, 2014 1:29 pm Post subject: |
|
|
Centurion
Joined: 15 Apr 2014 Posts: 118
|
If I understand you... read the entire file and treat as one message. If OK-> continue to next node and parse individual line messages. If invalid->take exception path. Close?
What if I don't want to read an entire file as a message due to size or some other consideration? Separate topic?  |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri May 09, 2014 1:50 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Your parsing model is the line.
Now you can read the entire file as one message with multiple lines And use large message techniques... or record by record.... it really makes no difference in this regard.
What you do want to be able to do, is use a try-catch node to isolate your detail parsing from errors that would prevent you from fetching the next record...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Dave Ziegler |
Posted: Fri Jun 13, 2014 8:02 pm Post subject: |
|
|
Centurion
Joined: 15 Apr 2014 Posts: 118
|
fjb_saper, Edit: your email made a light bulb go on so I will try something else and get back to you. |
|
Back to top |
|
 |
kimbert |
Posted: Sun Jun 15, 2014 11:32 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
The trick is to model the file as a sequence of lines, with each line being a string or a BLOB ( and not a sequence of fields ). Later in the flow, use an RCD node to switch to a more detailed model. _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
|