1

当有大量步骤时,spring batch admin 需要 10 多分钟才能在部署期间注册步骤执行。由于部署需要超过 10 分钟,因此部署失败。

每个步骤都会出现以下日志:

INFO  [org.springframework.batch.admin.jmx.BatchMBeanExporter] (MSC service thread 1-7) Registering  step execution job-process/do-job-master:1934
INFO  [org.springframework.batch.admin.jmx.BatchMBeanExporter] (MSC service thread 1-7) Located managed bean 'spring.application:type=JobExecution,name=job-process,step=do-job-master@1934': registering with JMX server as MBean [spring.application:type=JobExecution,name=job-process,step=do-job-master@1934]

为什么会发生这种情况,如何禁用加载 Spring Batch Admin 加载的所有步骤执行?

4

1 回答 1

3

When Spring Batch Admin deploys it registers all step executions with JMX. When you have a large number of step executions in the database it can take a long time to register all of them with JMX. If you do not need JMX you can disable it by overriding the batchMBeanExporter bean in your context. If you must have JMX, then you should seek to reduce the number of steps executions, if thats not possible reach out to Spring.

I disabled JMX by adding the following bean definition to my context files:

<bean id="batchMBeanExporter" class="java.lang.String" />
于 2014-05-04T13:24:25.263 回答