弹簧批的优点 [英] Advantages of spring batch

查看:101
本文介绍了弹簧批的优点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我了解到Spring批处理框架按块处理数据.但是,我在想,当可以通过java实现相同的分块功能时,为什么我们需要使用批处理框架.

I understood that spring batch framework processes data in chunks. However, I was thinking that when the same chunking functionality can be acheived through java why do we need to go for batch framework.

请问有什么理由让我使用Spring Batch框架吗?

Could any one please let me know if there are more reasons for going to spring batch framework?

推荐答案

让我稍微改一下您的问题,看看是否可以解决.

Let me rephrase your question a bit and see if this addresses it.

Spring Batch提供了什么,在构建批处理应用程序时我必须自己处理?

Spring Batch作为JSR-352(Java批处理规范)的基础,并且由于该规范已经发布,因此Java空间中现在有很多Spring Batch可用.话虽如此,Spring Batch在基本Java的功能范围之外仍然提供了很多功能:

Spring Batch served as the basis for JSR-352 (the java batch specification) and since that specification has come out, there is a lot of Spring Batch now available within the java space. That being said, there is still a lot that Spring Batch provides outside of the scope of what basic Java does:

基本"批处理作业内

在简单批处理作业的范围内,Spring Batch提供了一组实用程序和实现,这些实用程序和实现已在所有企业垂直领域中经过了实战测试.一些示例是:

Within the scope of a simple batch job, Spring Batch provides a collection of utilities and implementations that have been battle tested in all enterprise verticals. Some examples are:

  • 超过17个ItemReader和15个ItemWriter实现,涵盖了输入和输出(文件,JDBC,NoSQL,JMS等)的大量选项.所有这些都提供了声明性的I/O选项,因此您不必为有状态的读写器编写和测试代码.
  • Tasklet(Spring Batch与JSR-352的Batchlet等效)实现的集合,包括用于执行Shell命令和与Hadoop接口的实现.
  • 停止/启动/重新启动作业并在两次执行之间保持状态的能力.
  • 在处理记录时可以跳过并重试记录的功能.
  • 交易管理. Spring Batch为您处理交易.
  • 通过集成Spring Integration通过消息传递在发生错误时通知其他系统的能力.
  • 基于Java或XML的配置.
  • 所有Spring功能,例如DI,AOP,可测试性等.
  • 供应商独立性-通过使用Spring Batch,您可以使用开放源代码且不受任何供应商约束的框架.
  • Over 17 ItemReader and 15 ItemWriter implementations covering vast options for input and output (File, JDBC, NoSQL, JMS, etc). All of these provide declarative I/O options so that you don't have to write and test code for stateful readers and writers.
  • A collection of Tasklet (Spring Batch's equivalent to JSR-352's Batchlet) implementations including ones for executing shell commands and interfacing with Hadoop.
  • The ability to stop/start/restart jobs and maintain state between executions.
  • The ability to skip and retry records as they are being processed.
  • Transaction management. Spring Batch handles transactions for you.
  • The ability to notify other systems when errors occur via messaging by integrating Spring Integration.
  • Java or XML based configuration.
  • All the Spring features like DI, AOP, testability, etc.
  • Vendor independence - By using Spring Batch, you get to use a framework that open source and not tied to any one vendor.

其他优势

除了上面提到的Spring Batch带给桌面的例子之外,它还有更多的地方:

Beyond the above examples of what Spring Batch brings to the table, it goes much further:

  • 可伸缩性选项-Spring Batch提供了许多可伸缩性选项,范围从单个JVM中的线程(多线程步骤,本地分区和拆分)到多JVM的可伸缩性(远程分区和远程分块).
  • 与Spring Integration集成-Spring Integration提供了许多有用的元素,可让您构建健壮的批处理应用程序来处理诸如错误消息,为文件查询目录,自动FTPing文件等之类的事情.
  • 大数据支持-在Spring for Apache Hadoop项目中,Spring Batch进行了许多扩展,使其可以与Hadoop很好地配合使用.您可以在YARN上运行Spring Batch作业,也可以执行Pig,Hive,MapReduce等作业.
  • 与Spring XD集成-Spring XD为分布式作业的部署,管理和执行提供了分布式运行时.

我个人将批处理视为编程的设置好了就忘了".虽然不那么性感,但批处理是一种非常有用的处理模型,并且在某些地方比大多数人意识到的有用. Spring Batch提供了一个环境,使开发轻松容易的批处理作业变得容易.

I personally view batch processing as the "set it and forget it" model of programming. While it isn't sexy, batch processing is a very useful model of processing and is more useful in places than most people realize. Spring Batch provides an environment that makes developing robust batch jobs as easily as possible.

这篇关于弹簧批的优点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆