Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance Issue with @sap-cloud-sdk/http-client #5056

Open
zarar1210 opened this issue Oct 3, 2024 · 0 comments
Open

Performance Issue with @sap-cloud-sdk/http-client #5056

zarar1210 opened this issue Oct 3, 2024 · 0 comments
Labels
question Further information is requested

Comments

@zarar1210
Copy link

zarar1210 commented Oct 3, 2024

Problem Statement:

I am using Node.js version 20 and the @sap-cloud-sdk/http-client to make POST requests, but I am encountering APIs performance issues. However, when using Node.js version 18 with sap-cf-axios, the performance is better, and I receive APIs responses more quickly.

Any one please help me out here on performance issues ?

Note: We are using Cloud SDk library ->@sap-cloud-sdk/http-client - npm (npmjs.com) and it function executeHttpRequest to send request to convergent mediation system(On premise ) via cloud connector .The connectivity is made using Destination which is maintained in BTP subaccount and same for sap-cf-axios,

Function -1

const httpclient = require('@sap-cloud-sdk/http-client');
async function callSoapApi(data, req, res) {
    await httpclient.executeHttpRequest(
        {
            destinationName: destination
        },
        {
            method: 'POST',
            url: req.url,
            data: data,
            headers: {
                SOAPAction: "SOAP ACTION NAME"
            }
        },
        {
            fetchCsrfToken: false
        }
    ).then(response => {
        res.status(200).send(response.data);
    }).catch(error => {
        generateErrorMessage(req, res, error);// Separate function for error handling
    });
}

Function -2

let SapCfAxios = require('sap-cf-axios').default;

let callSoapApi = async (data, req, res) => {
    try {
        let axios = SapCfAxios("Destination_name");
        let dataResp = await axios({
            method: "POST",
            url: req.url,
            data: data,
            headers: {
                SOAPAction: "SOAP ACTION NAME", // Replace with your SOAP action
            }
        });
        res.status(200).send(dataResp.data);
    } catch (error) {
        generateErrorMessage(req,res,error); //Separate function for error handling
    }
}
@zarar1210 zarar1210 added the question Further information is requested label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant