PDA

View Full Version : Using something other than file/db as input source?



kettle_bradtwurst
04-26-2006, 02:18 PM
Hello all,


Simple question: Is it possible to have a input source that didn't originate from a file or a database?



The scenario that I envision:

<hr />
I am using kettle embedded in a server that I have running. That server receives an XML document via some external request (web service call, jms message, etc). This document contains the information that I want to be a data source for a transformation.
<hr />


Now, I know that I could write the XML string out to a text file that I could then use for input, but I was wondering if this could be done without the intermediate step.



I've looked through the documentation and I didn't see a 'Step' for this.



Thanks in advance for your response,
James

MattCasters
04-26-2006, 07:56 PM
James,


This most certainly can be done. You need to construct the rows you want to pass to Kettle although this is very easy.
(Row.addValue() ...)



Then you need to pass the rows to the transformation. You can either write your own plugin for this or re-use stuff like "Get rows from result" or simply a Dummy. Calling the "putRow()" method of a running step is basically all you need to to. Trans is already running in a different thread, so yeah very feasible. At the end you call setOutputDone() and stop the step. (see source code of Dummy)



All the best,



Matt

kettle_anonymous
04-27-2006, 06:54 AM
Matt,


Thanks for the quick response.



You are really helping me grasp kettle reality :)



James