Question
AMERICAN EXPRESS
US
Last activity: 8 May 2024 9:52 EDT
To capture Request & Response for Connect REST
From PEGA 7.4 as all code logics in pyInvokeRESTConnector moved inside Engine code which hinders the customization which we had earlier.
In 7.1.7 which allowed to customize to capture request/response
But from 7.4 (including 8.8) all the Java steps were gone and replaced by single Java step which directly calls the function, so no customization possible.
Please help to us inorder to log request/response which is critical for our application performance metrics.
More details on the attachment
***Edited by Moderator Marissa to add Support Case details***
-
Reply
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Bits in Glass
IN
@VINODHKANNAR16773698 you can have a concrete class of yourself inheriting from Log-connect-Error and you can set request and response to a page and you can save that page as a blob.
AMERICAN EXPRESS
US
@Anoop Krishna . Thanks for suggesting that, but i assume that approach might not work for us as we want to capture for both successful & Error REST calls, as we are using that for API metrics for support & analysis.
Bits in Glass
IN
@VINODHKANNAR16773698 yes you can, we are also capturing request and response everytime. We just inherited from that class to reuse the properties. You can have a separate class and properties of your own to achieve the same.
Pegasystems Inc.
CA
@VINODHKANNAR16773698 You can enable the debug to capture request/response.
Configurations -> Settings -> Operations -> Logs
Enbaling the "Debug/All" for "com.pega.pegarules.integration.engine.internal.connect.rest.RESTConnector" class will log the content of request and response.
I hope this helps!
AMERICAN EXPRESS
US
@RameshSangili We use this for any adhoc debug, but the log debug settings will lost anytime the server is restarted, that why we customized pyinvokerestconnector to log explicitly earlier.
Nagarro
IN
@VINODHKANNAR16773698You can create your own dedicated table which can have some columns like Request (blob type) , response (blob type), createdatetime , updatedatetime, PrimaryKey (whatever suits as per your business or pyGUID).
Create a utility which will take these values as params and then save in the table created by you. you can add this utility in every service/connector activity at the end. And response column can contain error or successful response..
AMERICAN EXPRESS
US
@lakhank7 Correct, That is how we were capturing the request&response inside the pyInvokeRESTconnector inside one of its Java step so far till 7.1.7 . But now after 7.4 PEGA moved all Java steps into Engine code, so we are losing customization post uplift if we use the OOTB pyInvokeRESTConnector. Using our old custom pyInvokeRESTconnecting having issues on 2 way SSL issue with new Java version. so we are kind of in a grid lock. Looking for generalized solution as all clients might have similar reporting on stats on all API calls From & To on the application for remediation / analysis.
DCS
GB
@VINODHKANNAR16773698 , Did you manage to get an answer to this query? (to capture the request and response payloads for a connect-rest method in an Activity in the latest/most recent versions of Pega?
Thanks,
Nanjundan Chinnasamy | Lead Decision architect
Bits in Glass
CA
@VINODHKANNAR16773698 I also need to do a similar thing in one of the projects, were you able to find any solution for this?
DCS
GB
Hi @MandeepRawat, Can you please try with the solution shared in my recent post? I managed to capture the request and response payloads and store in DB.
Thanks,
Nanjundan Chinnasamy | DCS | 1:1 Customer Engagement
Pegasystems Inc.
GB
@Nanjundan Chinnasamy please can you mark the correct reply with 'Accept Solution' so that our users can find this in the future?