I'm trying to create a Kettle transformation to populate my Spark Java (sparkjava.com) server,deployed on heroku, instead of inserting the data by hand. The code on the server side to take care of a Post request on the route "/insert" is the following :
post("/insert", (req, repl) -> {
String json=new String(req.bodyAsBytes());
/*Some processing...*/
MyRecordList myRL=MyRecordList.fromJsonString(json);
for (MyRecord mr : myRL.getRecords()) {
Instance inst = mr.toWekaInstance(trainset);
trainset.add(inst);
}
return "ok";
});
With this I believe the whole body will be the JSON of a MyRecordList object.
On the Pentaho side there's the HTTP Post step and the location definition is straightforward. However I'm stuck on how to specify a JSON string as the whole body of the post request and sending it to the server. According to the Heroku logs the request generated by Pentaho doesn't even reach the server. Here are the parameters I put there:
Can anyone please enlighten me, or show me other way to populate the server, that follows the restrictions above?