Skip the remainder of a Feed Iterator?

22 views
Skip to first unread message

bpevans

unread,
Apr 8, 2021, 9:07:47 PM4/8/21
to
I have sequential feed connectors (ldif file connector, iterator) in an assembly line.

Once I find an entry in the file I'd like to exit that feed iterator completely and proceed directly into the next feed iterator.

What user function is appropriate to call for this behaviour, from within the getNextSuccessful hook.

Eddie Hartman

unread,
Apr 10, 2021, 6:31:19 PM4/10/21
to
I would suggest coding the Override GetNext Hook and handling it yourself. For example, this will only return the first 5 entries before signalling EOD:
---
// Lazy man
if (typeof _cnt == "undefined") {
_cnt = 0;
}

readEntry = thisConnector.connector.getNextEntry();

if (cnt++ > 5 || readEntry == null) {
result.setStatus(0); // signal End Of Data
} else {
work.merge(readEntry);
result.setStatus(1);
}
---
Hope this helps!

/e

Eddie Hartman

unread,
Apr 10, 2021, 6:34:39 PM4/10/21
to
Or instead of the Connector interface method getNextEntry(), you can call the AssemblyLineComponent .getnext() function instead.

...
readEntry = thisConnector.getnext();
// https://www.stephen-swann.co.uk/javadoc/tdi7.2/com/ibm/di/server/AssemblyLineComponent.html#getnext()
...

That way you get Hooks, Input Map and Auto Reconnect/Connection Error functionality.

/e
Reply all
Reply to author
Forward
0 new messages