/
EagleML API Client - Example of Use (Async)

EagleML API Client - Example of Use (Async)

In this example we are launching 4 asynchronous extracts.

  • RTRs are generated from the ENTITYEXTRACT.txt query file located in testFolder:

    EN|EN|ActionType; EXTRACT; StreamName; eagle_ml-2-0_default_out_q; FeedType; ENTITYEXTRACT; maxrows; 10; EN|EN|ActionType; EXTRACT; StreamName; eagle_ml-2-0_default_out_q; FeedType; ENTITYEXTRACT; maxrows; 20; EN|EN|ActionType; EXTRACT; StreamName; eagle_ml-2-0_default_out_q; FeedType; ENTITYEXTRACT; maxrows; 30; EN|EN|ActionType; EXTRACT; StreamName; eagle_ml-2-0_default_out_q; FeedType; ENTITYEXTRACT; maxrows; 40;
  • Two queries are executed in parallel (-threads=2)

  • Metrics are have additional logging in metricsDir folder

  • Extracted data is saved to results folder

  • All necessary libraries required for the process are in the lib folder

  • To start execution we create runapitest.cmd file with the following contents:

    set EAGLEAPIPASS=eagle1 java -jar lib/eaglemlapiclient-1.0.1.jar -file=testFolder/ENTITYEXTRACT.txt -execution=async -endpoint=http://10.100.38.145/EagleMLWebService20 -login=eagleadmin -resultsdir=results -threads=2 -csvmetricsdir=metricsdir
  • To set IP address to receive response use (port is optional, any available port is used if value is not set):

    -callback-address=clientipaddress[:port]

This is how a working folder with such parameters should look like:

Run runapitest.cmd:

Let's see what is happening:

  1. Two RTRs have been generated from line 1 and line 2 of the query file with corrIds RM9Y4J2V5WKD and KHB2XM3SHXRB:

  2. These two RTRs have been taken and sent to EJM in two separate threads:

  3. Results of these requests arrived will SUCCESS status:

  4. Extract files are saved to results folder with the following names:
    EN_KHB2XM3SHXR B_ENTITYEXTRACT_20_20161208.xml.gz and
    EN_RM9Y4J2V5WK D_ENTITYEXTRACT_10_20161208.xml.gz :

  5. The same 4 steps are then performed for lines 3 and 4 of the testFolder/ENTITYEXTRACT.txt query file.

  6. You can trace these processes in Message Center Console:

  7. We can also find the RTR generated from line 2 of testFolder/ENTITYEXTRACT.txt here:

  8. For line 1 of testFolder/ENTITYEXTRACT.txt (corrId EN_RM9Y4J2V5WKD):

  9. You can see the trigger created to send via WS in the screenshot:

  10. Now let's check the result of extraction:
    results folder:

    metricsDir folder:

    This folder contains CSV-formatted copies of metrics:

    eagle.eaglemlapi.asyncrequest.reply.datasize – size of incoming data;
    eagle.eaglemlapi.asyncrequest.ack – time, in which ACK has arrived;
    eagle.eaglemlapi.asyncrequest.ack.parse – time of ACK processing;
    eagle.eaglemlapi.asyncrequest.reply.processed – time of multipart (TSR+data extact) processing;
    eagle.eaglemlapi.asyncrequest.reply.received – time, in which multipart has arrived;
    eagle.eaglemlapi.asyncrequest.reply.saved – time spent on saving extract data;
    eagle.eaglemlapi.asyncrequest.reply.tsrparsed – time of TSR processing;