1

有没有办法在spring batch admin的用户界面添加job的描述?

虽然,我尝试添加作业的描述,但 spring batch admin 无法支持它。我想知道spring batch admin是否不支持。

4

2 回答 2

3

我知道我参加聚会迟到了,但我想通了,它对我来说完美无缺。您所要做的就是:

  1. 在类路径中添加一个messages.properties文件(在 src/main/resources 下)。
  2. 添加yourJobName.description=Your description goes here该文件。
  3. manager-context.xml通过在路径上创建文件覆盖SBAsrc/main/resources/META-INF/spring/batch/servlet/override/manager-context.xml
  4. 上面创建的文件的内容应该是:

`

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" 
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans  
           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
  <!-- Override messageSource bean in order to provide custom text content -->
  <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
    <property name="basename" value="messages" />
  </bean>
</beans>

`

而已。您的自定义描述显示在 SBA 中。希望这对正在寻找它的人有所帮助。

于 2016-12-02T22:44:17.037 回答
0

没有开箱即用的能力来显示工作的描述。这仅包含在 XML 中,并且在 UI 中看到的数据来自 JobRepository。您必须扩展 UI 才能添加该功能。

于 2014-05-07T14:26:36.390 回答