Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Managing multiple Rest Client responses

  1. #1
    Join Date
    Feb 2017
    Posts
    2

    Question Managing multiple Rest Client responses

    I'm working on a ETL job that requires me to use REST/HTTP client to make calls to a set of URLs like :

    https://abc.xyz.com/email/jobid/123
    https://abc.xyz.com/email/jobid/456
    https://abc.xyz.com/email/jobid/789
    https://abc.xyz.com/email/jobid/349

    Im reading the URls from a csv file adn using each line to trigger the REST/HTTP client

    The response is in JSON format and i need help on how to store the responses in a separate file for each URL.

    Thanks in advance



    Version 6.1
    Windows 10 32bit
    Last edited by samarth; 02-22-2017 at 12:57 AM. Reason: extra info added

  2. #2
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    The Process-Files step is your friend here.

    Read your URIs with Text-File-Input, create a target filename e.g. in a User-Defined-Java-Expression, and let Process-Files handle the rest (Copy mode).


    EDIT

    Just tried in my environment and Copy didn't work so I ended up using REST-Client and Text-File-Output.
    Last edited by marabu; 02-22-2017 at 04:59 AM.
    So long, and thanks for all the fish.

  3. #3
    Join Date
    Feb 2017
    Posts
    2

    Smile thanks!

    any way i can use text file output to create new file for each URL?

    Quote Originally Posted by marabu View Post
    The Process-Files step is your friend here.

    Read your URIs with Text-File-Input, create a target filename e.g. in a User-Defined-Java-Expression, and let Process-Files handle the rest (Copy mode).


    EDIT

    Just tried in my environment and Copy didn't work so I ended up using REST-Client and Text-File-Output.

  4. #4
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Yes, of course.
    You could use a Java expression or Replace-In-String to derive the output filename from the URI.
    TFO can accept its filename from a field.
    Clear separator and delimiter and emit the REST-Client result field without header row.
    So long, and thanks for all the fish.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.