41.b10ef41f.js 10.4 KB
Newer Older
茶陵後's avatar
茶陵後 已提交
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[41],{469:function(e,r,t){"use strict";t.r(r);var a=t(56),s=Object(a.a)({},(function(){var e=this,r=e.$createElement,t=e._self._c||r;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"what-s-new-in-spring-batch-4-3"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#what-s-new-in-spring-batch-4-3"}},[e._v("#")]),e._v(" What’s New in Spring Batch 4.3")]),e._v(" "),t("h2",{attrs:{id:"what-s-new-in-spring-batch-4-3-2"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#what-s-new-in-spring-batch-4-3-2"}},[e._v("#")]),e._v(" What’s New in Spring Batch 4.3")]),e._v(" "),t("p",[e._v("This release comes with a number of new features, performance improvements,\ndependency updates and API deprecations. This section describes the most\nimportant changes. For a complete list of changes, please refer to the"),t("a",{attrs:{href:"https://github.com/spring-projects/spring-batch/releases/tag/4.3.0",target:"_blank",rel:"noopener noreferrer"}},[e._v("release notes"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h3",{attrs:{id:"new-features"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#new-features"}},[e._v("#")]),e._v(" New features")]),e._v(" "),t("h4",{attrs:{id:"new-synchronized-itemstreamwriter"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#new-synchronized-itemstreamwriter"}},[e._v("#")]),e._v(" New synchronized ItemStreamWriter")]),e._v(" "),t("p",[e._v("Similar to the "),t("code",[e._v("SynchronizedItemStreamReader")]),e._v(", this release introduces a"),t("code",[e._v("SynchronizedItemStreamWriter")]),e._v(". This feature is useful in multi-threaded steps\nwhere concurrent threads need to be synchronized to not override each other’s writes.")]),e._v(" "),t("h4",{attrs:{id:"new-jpaqueryprovider-for-named-queries"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#new-jpaqueryprovider-for-named-queries"}},[e._v("#")]),e._v(" New JpaQueryProvider for named queries")]),e._v(" "),t("p",[e._v("This release introduces a new "),t("code",[e._v("JpaNamedQueryProvider")]),e._v(" next to the"),t("code",[e._v("JpaNativeQueryProvider")]),e._v(" to ease the configuration of JPA named queries when\nusing the "),t("code",[e._v("JpaPagingItemReader")]),e._v(":")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('JpaPagingItemReader<Foo> reader = new JpaPagingItemReaderBuilder<Foo>()\n   .name("fooReader")\n   .queryProvider(new JpaNamedQueryProvider("allFoos", Foo.class))\n   // set other properties on the reader\n   .build();\n')])])]),t("h4",{attrs:{id:"new-jpacursoritemreader-implementation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#new-jpacursoritemreader-implementation"}},[e._v("#")]),e._v(" New JpaCursorItemReader Implementation")]),e._v(" "),t("p",[e._v("JPA 2.2 added the ability to stream results as a cursor instead of only paging.\nThis release introduces a new JPA item reader that uses this feature to\nstream results in a cursor-based fashion similar to the "),t("code",[e._v("JdbcCursorItemReader")]),e._v("and "),t("code",[e._v("HibernateCursorItemReader")]),e._v(".")]),e._v(" "),t("h4",{attrs:{id:"new-jobparametersincrementer-implementation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#new-jobparametersincrementer-implementation"}},[e._v("#")]),e._v(" New JobParametersIncrementer implementation")]),e._v(" "),t("p",[e._v("Similar to the "),t("code",[e._v("RunIdIncrementer")]),e._v(", this release adds a new "),t("code",[e._v("JobParametersIncrementer")]),e._v("that is based on a "),t("code",[e._v("DataFieldMaxValueIncrementer")]),e._v(" from Spring Framework.")]),e._v(" "),t("h4",{attrs:{id:"graalvm-support"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#graalvm-support"}},[e._v("#")]),e._v(" GraalVM Support")]),e._v(" "),t("p",[e._v("This release adds initial support to run Spring Batch applications on GraalVM.\nThe support is still experimental and will be improved in future releases.")]),e._v(" "),t("h4",{attrs:{id:"java-records-support"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#java-records-support"}},[e._v("#")]),e._v(" Java records Support")]),e._v(" "),t("p",[e._v("This release adds support to use Java records as items in chunk-oriented steps.\nThe newly added "),t("code",[e._v("RecordFieldSetMapper")]),e._v(" supports data mapping from flat files to\nJava records, as shown in the following example:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('@Bean\npublic FlatFileItemReader<Person> itemReader() {\n\treturn new FlatFileItemReaderBuilder<Person>()\n\t\t\t.name("personReader")\n\t\t\t.resource(new FileSystemResource("persons.csv"))\n\t\t\t.delimited()\n\t\t\t.names("id", "name")\n\t\t\t.fieldSetMapper(new RecordFieldSetMapper<>(Person.class))\n\t\t\t.build();\n}\n')])])]),t("p",[e._v("In this example, the "),t("code",[e._v("Person")]),e._v(" type is a Java record defined as follows:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("public record Person(int id, String name) { }\n")])])]),t("p",[e._v("The "),t("code",[e._v("FlatFileItemReader")]),e._v(" uses the new "),t("code",[e._v("RecordFieldSetMapper")]),e._v(" to map data from\nthe "),t("code",[e._v("persons.csv")]),e._v(" file to records of type "),t("code",[e._v("Person")]),e._v(".")]),e._v(" "),t("h3",{attrs:{id:"performance-improvements"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#performance-improvements"}},[e._v("#")]),e._v(" Performance improvements")]),e._v(" "),t("h4",{attrs:{id:"use-bulk-writes-in-repositoryitemwriter"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#use-bulk-writes-in-repositoryitemwriter"}},[e._v("#")]),e._v(" Use bulk writes in RepositoryItemWriter")]),e._v(" "),t("p",[e._v("Up to version 4.2, in order to use "),t("code",[e._v("CrudRepository#saveAll")]),e._v(" in "),t("code",[e._v("RepositoryItemWriter")]),e._v(",\nit was required to extend the writer and override "),t("code",[e._v("write(List)")]),e._v(".")]),e._v(" "),t("p",[e._v("In this release, the "),t("code",[e._v("RepositoryItemWriter")]),e._v(" has been updated to use"),t("code",[e._v("CrudRepository#saveAll")]),e._v(" by default.")]),e._v(" "),t("h4",{attrs:{id:"use-bulk-writes-in-mongoitemwriter"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#use-bulk-writes-in-mongoitemwriter"}},[e._v("#")]),e._v(" Use bulk writes in MongoItemWriter")]),e._v(" "),t("p",[e._v("The "),t("code",[e._v("MongoItemWriter")]),e._v(" used "),t("code",[e._v("MongoOperations#save()")]),e._v(" in a for loop\nto save items to the database. In this release, this writer has been\nupdated to use "),t("code",[e._v("org.springframework.data.mongodb.core.BulkOperations")]),e._v(" instead.")]),e._v(" "),t("h4",{attrs:{id:"job-start-restart-time-improvement"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#job-start-restart-time-improvement"}},[e._v("#")]),e._v(" Job start/restart time improvement")]),e._v(" "),t("p",[e._v("The implementation of "),t("code",[e._v("JobRepository#getStepExecutionCount()")]),e._v(" used to load\nall job executions and step executions in-memory to do the count on the framework\nside. In this release, the implementation has been changed to do a single call to\nthe database with a SQL count query in order to count step executions.")]),e._v(" "),t("h3",{attrs:{id:"dependency-updates"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#dependency-updates"}},[e._v("#")]),e._v(" Dependency updates")]),e._v(" "),t("p",[e._v("This release updates dependent Spring projects to the following versions:")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("Spring Framework 5.3")])]),e._v(" "),t("li",[t("p",[e._v("Spring Data 2020.0")])]),e._v(" "),t("li",[t("p",[e._v("Spring Integration 5.4")])]),e._v(" "),t("li",[t("p",[e._v("Spring AMQP 2.3")])]),e._v(" "),t("li",[t("p",[e._v("Spring for Apache Kafka 2.6")])]),e._v(" "),t("li",[t("p",[e._v("Micrometer 1.5")])])]),e._v(" "),t("h3",{attrs:{id:"deprecations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#deprecations"}},[e._v("#")]),e._v(" Deprecations")]),e._v(" "),t("h4",{attrs:{id:"api-deprecation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#api-deprecation"}},[e._v("#")]),e._v(" API deprecation")]),e._v(" "),t("p",[e._v("The following is a list of APIs that have been deprecated in this release:")]),e._v(" "),t("ul",[t("li",[t("p",[t("code",[e._v("org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean")])])]),e._v(" "),t("li",[t("p",[t("code",[e._v("org.springframework.batch.core.explore.support.MapJobExplorerFactoryBean")])])]),e._v(" "),t("li",[t("p",[t("code",[e._v("org.springframework.batch.core.repository.dao.MapJobInstanceDao")])])]),e._v(" "),t("li",[t("p",[t("code",[e._v("org.springframework.batch.core.repository.dao.MapJobExecutionDao")])])]),e._v(" "),t("li",[t("p",[t("code",[e._v("org.springframework.batch.core.repository.dao.MapStepExecutionDao")])])]),e._v(" "),t("li",[t("p",[t("code",[e._v("org.springframework.batch.core.repository.dao.MapExecutionContextDao")])])]),e._v(" "),t("li",[t("p",[t("code",[e._v("org.springframework.batch.item.data.AbstractNeo4jItemReader")])])]),e._v(" "),t("li",[t("p",[t("code",[e._v("org.springframework.batch.item.file.transform.Alignment")])])]),e._v(" "),t("li",[t("p",[t("code",[e._v("org.springframework.batch.item.xml.StaxUtils")])])]),e._v(" "),t("li",[t("p",[t("code",[e._v("org.springframework.batch.core.launch.support.ScheduledJobParametersFactory")])])]),e._v(" "),t("li",[t("p",[t("code",[e._v("org.springframework.batch.item.file.MultiResourceItemReader#getCurrentResource()")])])]),e._v(" "),t("li",[t("p",[t("code",[e._v("org.springframework.batch.core.JobExecution#stop()")])])])]),e._v(" "),t("p",[e._v("Suggested replacements can be found in the Javadoc of each deprecated API.")]),e._v(" "),t("h4",{attrs:{id:"sqlfire-support-deprecation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#sqlfire-support-deprecation"}},[e._v("#")]),e._v(" SQLFire support deprecation")]),e._v(" "),t("p",[e._v("SQLFire has been in "),t("a",{attrs:{href:"https://www.vmware.com/latam/products/pivotal-sqlfire.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("EOL"),t("OutboundLink")],1),e._v("since November 1st, 2014. This release deprecates the support of using SQLFire\nas a job repository and schedules it for removal in version 5.0.")])])}),[],!1,null,null,null);r.default=s.exports}}]);