Question

Is there a way to make a Spring bean's "request" scope work with Mule? According to the Spring documentation, "request" and "session" scopes are "Only valid in the context of a web-aware Spring ApplicationContext." But there should be a way to make Mule ESB web-aware, no? It definitely does not work out of the box. If I try adding the following declaration to my application, Mule won't even start up; it just hangs...

<beans xmlns="http://www.springframework.org/schema/beans">
    <bean id="accountManager" class="com.ergo.AccountManager" scope="request"/>
</beans>

No correct solution

OTHER TIPS

you can define CustomScope for request in Spring and use that for defining beans in mule as below.

<spring:bean
        class="org.springframework.beans.factory.config.CustomScopeConfigurer">
        <spring:property name="scopes">
            <spring:map>
                <spring:entry key="request">
                    <spring:bean
                        class="org.springframework.context.support.SimpleThreadScope" />
                </spring:entry>
            </spring:map>
        </spring:property>
    </spring:bean>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top