Hello all.

Found a solution.
On the LookupRecord, I put those properties:
mime.type : toString('application/json', 'UTF-8')
request.body : toString('{...}', 'UTF-8')
request.method : toString('POST', 'UTF-8')

With a big difficulty, the request.body variable content should not
contains any carriage return.

It seems to send the properties correctly.

But now, I am not able to set timeout and readtimeout on the HTTP call.
The request service is pretty slow... So I am always reaching the timeout.

Do you know if there is a header or something I can send to setup
differents timeouts ?

Regards

Etienne Jouvin







Le mer. 4 déc. 2019 à 20:31, Etienne Jouvin <[email protected]> a
écrit :

> Hello all.
>
> I am trying a little bit the LookupRecord with RestlookupService.
>
> When watching the code for RestLookupService, we can see the following in
> the lookup function :
> final String endpoint = determineEndpoint(coordinates);
> final String mimeType = (String)coordinates.get(MIME_TYPE_KEY);
> final String method = ((String)coordinates.getOrDefault(METHOD_KEY, "get"
> )).trim().toLowerCase();
> final String body = (String)coordinates.get(BODY_KEY);
>
> Ok it is looking nice, we can send the body and method type.
>
> So, I am build the request body in an attribute of the flow file, then set
> attributes as it :
> request.body :  {....}
> request.method :  POST
>
>
> BUT those values are not sent to the service.
> When I analyzed the LookupRecord code, I found the function route, where
> in fact the coordinates are only built when recordPath evaluation.
>
> Does it means the mime.type, method and body should be retrieve from a
> record path evaluate on the flowfile body content ?
>
> Regards.
>
> Etienne Jouvin
>
>

Reply via email to