Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Batch guide to support Batch 5 and Boot 3 #45

Merged
merged 2 commits into from
Dec 13, 2022

Conversation

robertmcnees
Copy link
Contributor

No description provided.

@@ -114,22 +114,8 @@ classes that reduce the need to write custom code. Instead, you can focus on the
logic.

To configure your job, you must first create a Spring `@Configuration` class like the following example in
`src/main/java/com/exampe/batchprocessing/BatchConfiguration.java`:

====
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove the code listing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code listing I removed highlighted 3 parts of code:

  • @EnableBatchProcessing
  • @Autowired JobBuilderFactory
  • @Autowired StepBuilderFactory

All 3 of those components have been removed from the new version of of BatchConfiguration.java so this code snippet was no longer showing any code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Also, good to know.

For starters, the `@EnableBatchProcessing` annotation adds many critical beans that
support jobs and save you a lot of leg work. This example uses a memory-based database
(provided by `@EnableBatchProcessing`), meaning that, when it is done, the data is gone. It also autowires a couple factories needed further below.
`src/main/java/com/exampe/batchprocessing/BatchConfiguration.java`. This example uses a memory-based database,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make the new sentence be a note. I would also reword it into two sentences, so that it's not such a complex sentence:

This example uses an in-memory database. When the application shuts down, no data is retained.

@Buzzardo Buzzardo merged commit 19b0881 into spring-guides:main Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants