There isn't the ability out of the box to display the job's description. That is only contained in the XML and the data seen in the UI comes from the JobRepository. You'd have to extend the UI to add that functionality.
How to add the description of job in spring batch admin user interface?
-
16-07-2023 - |
문제
Is there any way to add the description of job at the user interface of spring batch admin?
Although, I tried to added the description of the job, spring batch admin cannot support it. I would like to know that whether spring batch admin does not support it or not.
해결책 2
다른 팁
I know i'm late to the party but I figured it out and it works flawlessly for me. All you have to do is :
- Add a
messages.properties
file in your classpath (under src/main/resources). - Add
yourJobName.description=Your description goes here
in that file. - Override
manager-context.xml
for SBA by creating a file on pathsrc/main/resources/META-INF/spring/batch/servlet/override/manager-context.xml
- The content of the above created file should be :
`
<?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>
`
That's it. Your custom description shows up in SBA. Hope this helps someone who's looking for it.
제휴하지 않습니다 StackOverflow