问题
I have a server which can send response of any size. When I make calls of with response size 1MB the WSO2 api manger works fine. (1000 requests per minute) When we make same calls with response size of 10MB the WSO2 api manager initially cuts down the size of responnse and finally becomes 0 sized responses. With 1000 requests per minute only first 28 requests response back with 10MB others are lesser size. I have tried hitting the backend service directly with 10MB response sizes and all the responses are 10MB.
Here is my server.js (written for nodejs)
var http = require("http");
var url = require('url');
var server = http.createServer(function(request, response) {
var params = url.parse(request.url, true).query;
var size = parseInt(params.size);
var buffer = new Buffer(size);
buffer.fill("a");
response.write(buffer.toString());
response.end();
});
server.listen(8083);
console.log("Server is listening");
WSO2 hits this server with a parameter size.
My direct http call looks like
wget http://A.B.C.D:8083/?size=10485760
My WSO2 call looks like
wget --header="Authorization: Bearer Xobzt7lefiMadwt4u4Vp9q93dR8a" -qO- http://E.F.G.H:8280/loadtest/1.0/?size=10485760
Log shows the error with stack trace
java.lang.IllegalStateException: I/O reactor has been shut down at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.connect(DefaultConnectingIOReactor.java:229) at org.apache.synapse.transport.nhttp.HttpCoreNIOSender.sendAsyncRequest(HttpCoreNIOSender.java:366) at org.apache.synapse.transport.nhttp.HttpCoreNIOSender.invoke(HttpCoreNIOSender.java:252) at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442) at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.send(DynamicAxisOperation.java:185) at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.executeImpl(DynamicAxisOperation.java:167) at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149) at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:460) at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:57) at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:325) at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:329) at org.apache.synapse.endpoints.AddressEndpoint.send(AddressEndpoint.java:59) at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:95) at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71) at org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:112) at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71) at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114) at org.apache.synapse.rest.Resource.process(Resource.java:297) at org.apache.synapse.rest.API.process(API.java:308) at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:76) at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:63) at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:191) at org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:83) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) at org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:144) at org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:139) at org.apache.synapse.transport.nhttp.util.RESTUtil.processGetAndDeleteRequest(RESTUtil.java:146) at org.apache.synapse.transport.nhttp.DefaultHttpGetProcessor.processGetAndDelete(DefaultHttpGetProcessor.java:464) at org.wso2.carbon.transport.nhttp.api.NHttpGetProcessor.process(NHttpGetProcessor.java:296)
Which will be followed by
[2013-11-16 17:25:12,679] INFO - LogMediator To: , MessageID: urn:uuid:aec86528-8132-4329-9262-9204a9f1317c, Direction: response, STATUS = Executing default 'fault' sequence, ERROR_CODE = 504, ERROR_MESSAGE = Send timeout, Envelope: 0Status reportRuntime ErrorUnexpected error during sending message out
来源:https://stackoverflow.com/questions/19788418/wso2-api-manager-stops-after-1000-sync-call-with-large-payload