View Full Version : Kettle data in a browser

04-26-2011, 06:10 PM
Dear Kettle fans,

As you can tell from the Kettle JDBC driver project (http://code.google.com/p/jdbckettle/wiki/JDBCConnection) and also from the Talend job execution (http://www.ibridge.be/?p=198) job entry (if you’re still wondering, that was NOT a joke) we announced a few weeks ago, we’re constantly looking for new and better ways to integrate Kettle into the wide world.

Today I’m blogging to spread the word about a new exciting possibility: expose Kettle data over a web service (http://jira.pentaho.com/browse/PDI-6123).

Here’s the situation: you have a 3rd party vendor that wants to read data from you. However, you don’t want to spend a lot of time coding web services and what not to deliver the data in a language neutral format. Anybody can read data from a simple web service. You can use any programming language and it’s easy to test in a browser.

The way that it works arguably couldn’t be easier… Let’s take a look.

We start with a simple transformation that reads some customer data. We take the “Read customer data” example from the samples:

samples/transformations/CSV Input - Reading customer data.ktr

Next, we’re going to replace the dummy step with a “Text File Output” step (or “XML Output” if you prefer that):


Save the transformation in the same samples folder under the “Servlet Data Example.ktr” filename. In my case the full filename is: (from the transformation settings dialog)

/home/matt/svn/kettle/trunk/samples/transformations/Servlet Data Example.ktr

Now you can use an instance of Carte that runs on your local host on port 8282 (execute carte.sh 8282) to get the data in your browser. The URL is easy to construct.

For file (XML) based transformations:


For transformations stored in a repository:


Please note that you need to replace forward slashes with %2F in your browser. That leads to this URL in our example:

http://cluster:cluster@ Data Example.ktr

The result is can be tested with your browser:


For the script kiddies among you it is possible to get a hold of the servlet print writer in JavaScript too:

var out = _step_.getTrans().getServletPrintWriter();
out.println(”Hello, world!\n


Well, there you have it. I hope you like this idea. You can try it out yourself if you download a new build of Pentaho Data Integration from our Jenkins CI build server (http://ci.pentaho.com/job/Kettle/).

Now excuse me while I put the same button in the “JSON Output” step…

Until next time,


More... (http://www.ibridge.be/?p=199)