use of org.wso2.transport.http.netty.contractimpl.sender.channel.BootstrapConfiguration in project wso2-synapse by wso2.
the class Axis2HttpTransportSender method init.
@Override
public void init(ConfigurationContext configurationContext, TransportOutDescription transportOutDescription) throws AxisFault {
httpWsConnectorFactory = new DefaultHttpWsConnectorFactory();
connectionManager = HttpUtils.getConnectionManager();
bootstrapConfiguration = new BootstrapConfiguration(new HashMap<>());
targetConfiguration = new TargetConfiguration(configurationContext, transportOutDescription);
targetConfiguration.build();
}
use of org.wso2.transport.http.netty.contractimpl.sender.channel.BootstrapConfiguration in project wso2-synapse by wso2.
the class TargetRequestHandler method createHttpClient.
public static HttpClientConnector createHttpClient(URL url, MessageContext msgContext, HttpWsConnectorFactory httpWsConnectorFactory, ConnectionManager connectionManager, BootstrapConfiguration bootstrapConfiguration, TargetConfiguration targetConfiguration) throws AxisFault {
try {
SenderConfiguration senderConfiguration = new SenderConfiguration();
populateSenderConfigurations(msgContext, senderConfiguration, targetConfiguration, url);
return httpWsConnectorFactory.createHttpClientConnector(bootstrapConfiguration, senderConfiguration, connectionManager);
} catch (Exception ex) {
throw new AxisFault("Error while creating the HTTP Client Connector. ", ex);
}
}
use of org.wso2.transport.http.netty.contractimpl.sender.channel.BootstrapConfiguration in project wso2-synapse by wso2.
the class Axis2HttpTransportSender method sendRequestToBackendService.
/**
* Sends an outbound request to the backend service.
*
* @param msgCtx axis2 message context
* @param url request URL of the backend service
* @throws IOException if something goes wrong when sending the outbound request to the backend service
*/
private void sendRequestToBackendService(MessageContext msgCtx, URL url) throws IOException {
HttpCarbonMessage outboundRequestMsg = TargetRequestHandler.createOutboundRequestMsg(url, msgCtx, targetConfiguration);
HttpClientConnector clientConnector = TargetRequestHandler.createHttpClient(url, msgCtx, httpWsConnectorFactory, connectionManager, bootstrapConfiguration, targetConfiguration);
TargetRequestHandler.sendRequest(clientConnector, outboundRequestMsg, msgCtx, targetConfiguration);
}
Aggregations