简体   繁体   中英

REST API : Issues using Aggregate and Iterate Mediator

在此处输入图片说明

Error Message: [2013-06-04 11:26:41,039] INFO - LogMediator To: http://www.w3.org/2005/08/addressing/anonymous , WSAction: , SOAPAction: , MessageID: urn:uuid:fce9fc4f-a071-4f62-8b5f-e982cf404619, Direction: response, Envelope: Not in GZIP format [2013-06-04 11:26:41,055] ERROR - AggregateMediator Error evaluating expression: /PACKAGE_OFFERS org.apache.synapse.SynapseException: Could not find matching elements to aggregate. at org.apache.synapse.mediators.eip.EIPUtils.enrichEnvelope(EIPUtils.java:149) at org.apache.synapse.mediators.eip.aggregator.AggregateMediator.getAggregatedMessage(AggregateMediator.java:393) at org.apache.synapse.mediators.eip.aggregator.AggregateMediator.completeAggregate(AggregateMediator.java:340) at org.apache.synapse.mediators.eip.aggregator.AggregateMediator.mediate(AggregateMediator.java:285) 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:265) at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:76) at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:50) at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:182) at org.apache.synapse.co re.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:443) at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:166) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:217) at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722) [2013-06-04 11:27:21,022] WARN - SourceHandler Connection time out after request is read: fe80:0:0:0:b1ac:716:923:abd3%33:61567->fe80:0:0:0:b1ac:716:923:abd3%33:8280

I have a REST API calling two DataServer Services DS-1 and and DS-2 ,after calling DS-1[XML over REST-GET],I perform an iteration over some repetitive elements and call DS-2[XML over REST-GET].On doing this I get the above listed Error. I am trying to fetch the right element. Please let me know if any additional configurations are required.

For Source Code Please Refer this LINK.

You use receive sequence.So, the 1st endpoint's results(response) will be received in that sequence(ie: iterate seq).After that no receiving sequence. Message flow is broken. You used aggregate in your initial sequence, which doesn't have meaning since, the response from the very first endpoint will be received at iterate-seq.

So, the aggregate will be happen against the initial request, which you sent to your API.

Can you try adding <send/> mediator before closing the <inSequence> as mentioned below.

            </case>
            <default/>
        </switch>
**<send/>**
    </inSequence>

This will make sure that your request will be received by the outSequence.

如果您尚未决定使用任何esb…请考虑UltraESB

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM