Skip to content

Make transport cleanup configurable #13064

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ public class APIMgtGatewayConstants {
public static final String OAUTH_ENDPOINT_INSTANCE = "oauth.instance";
public static final String VALIDATED_X509_CERT = "ValidatedX509Cert";
public static final String RESOURCE_SPAN = "API:Resource";
public static final String AUTO_TRANSPORT_OPERATION_CLEANUP = "autoTransportOperationCleanUp";

/**
* Web-sub related properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.apache.synapse.core.axis2.Axis2MessageContext;
import org.apache.synapse.rest.RESTConstants;
import org.wso2.carbon.CarbonConstants;
import org.wso2.carbon.apimgt.gateway.APIMgtGatewayConstants;
import org.wso2.carbon.apimgt.gateway.MethodStats;
import org.wso2.carbon.apimgt.gateway.handlers.security.APIKeyValidator;
import org.wso2.carbon.apimgt.gateway.handlers.security.APISecurityConstants;
Expand Down Expand Up @@ -94,6 +95,11 @@ public BasicAuthCredentialValidator() throws APISecurityException {
Options options = client.getOptions();
options.setCallTransportCleanup(true);
options.setManageSession(true);
if (System.getProperty(APIMgtGatewayConstants.AUTO_TRANSPORT_OPERATION_CLEANUP) != null) {
options.setProperty(ServiceClient.AUTO_OPERATION_CLEANUP,
Boolean.parseBoolean(
System.getProperty(APIMgtGatewayConstants.AUTO_TRANSPORT_OPERATION_CLEANUP)));
}
CarbonUtils.setBasicAccessSecurityHeaders(username, password, client);
} catch (AxisFault axisFault) {
throw new APISecurityException(APISecurityConstants.API_AUTH_GENERAL_ERROR, axisFault.getMessage(), axisFault);
Expand Down
Loading