
We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.
You are using the Mule Runtime 4.x.x and you seeing the following exception in the log files.
Root Exception stack trace: org.mule.runtime.core.internal.event.EventContextDeepNestingException: Too many child contexts nested. at org.mule.runtime.core.internal.event.AbstractEventContext.addChildContext(AbstractEventContext.java:117) at org.mule.runtime.core.internal.event.DefaultEventContext.child(DefaultEventContext.java:75) at org.mule.runtime.core.internal.event.DefaultEventContext.child(DefaultEventContext.java:56) at org.mule.runtime.core.privileged.processor.MessageProcessors.newChildContext(MessageProcessors.java:238) at org.mule.runtime.core.privileged.processor.MessageProcessors.processWithChildContext(MessageProcessors.java:226) at org.mule.runtime.config.internal.factories.FlowRefFactoryBean$FlowRefMessageProcessor.lambda$apply$0(FlowRefFactoryBean.java:218) at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:347) at org.mule.runtime.core.privileged.processor.chain.AbstractMessageProcessorChain$1.onNext(AbstractMessageProcessorChain.java:255) ... followed by a long stacktrace.
There is a (currenty undocumented) setting org.mule.runtime.core.privileged.event.BaseEventContext.maxDepth that has introduced a limitation on the number of invocations that you can have to a (sub)flow from a parent flow. This was done to prevent unnecessary stack overflows being generated when flows are called to frequently and too many contexts being created. By default, the setting org.mule.runtime.core.privileged.event.BaseEventContext.maxDepth is set to be 25, but can be increased.
1) Check the flows to ensure that the references to other flows is done without unnecessary recursion.
2) You can design alternative to a recursive flow call, you can have the following flow logic:
a) a VM listener flow that listens to a VM queue. You can initially populate this VM queue to trigger the process. At the end of this flow, you can decide whether to push a payload back into the VM queue (thus triggering the flow again), or breaking out of it altogether. This will avoid the long stack traces causing the nested context error.
We have attached a sample app in Mule 4 that will trigger counting from 1 - 10. Each time, it will aggregate the variable and pushes to the VM queue. If it goes over 10, it will stop the flow.
Run the following command to trigger the sample app running inside Studio:
curl localhost:8081
Please note, the connector versions will need to be reviewed and updated as needed in .jar file
001117902