statemachine_engine_test.xml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. ~ Copyright 1999-2019 Seata.io Group.
  4. ~
  5. ~ Licensed under the Apache License, Version 2.0 (the "License");
  6. ~ you may not use this file except in compliance with the License.
  7. ~ You may obtain a copy of the License at
  8. ~
  9. ~ http://www.apache.org/licenses/LICENSE-2.0
  10. ~
  11. ~ Unless required by applicable law or agreed to in writing, software
  12. ~ distributed under the License is distributed on an "AS IS" BASIS,
  13. ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. ~ See the License for the specific language governing permissions and
  15. ~ limitations under the License.
  16. -->
  17. <beans xmlns="http://www.springframework.org/schema/beans"
  18. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  19. xmlns:context="http://www.springframework.org/schema/context"
  20. xsi:schemaLocation="
  21. http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  22. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
  23. <bean id="stateMachineEngine" class="io.seata.saga.engine.impl.ProcessCtrlStateMachineEngine">
  24. <property name="stateMachineConfig" ref="defaultStateMachineConfig"></property>
  25. </bean>
  26. <bean id="defaultStateMachineConfig" class="io.seata.saga.engine.impl.DefaultStateMachineConfig">
  27. <property name="resources" value="saga/statelang/*.json"></property>
  28. <property name="enableAsync" value="true"></property>
  29. <property name="threadPoolExecutor" ref="threadExecutor" />
  30. </bean>
  31. <bean id="threadExecutor"
  32. class="org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean">
  33. <property name="threadNamePrefix" value="SAGA_ASYNC_EXE_" />
  34. <property name="corePoolSize" value="1" />
  35. <property name="maxPoolSize" value="20" />
  36. <property name="queueCapacity" value="100" />
  37. <property name="rejectedExecutionHandler" ref="callerRunsPolicy" />
  38. </bean>
  39. <bean name="callerRunsPolicy" class="java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy">
  40. </bean>
  41. <bean id="demoService" class="io.seata.saga.engine.mock.DemoService"/>
  42. </beans>