HoneyMoose
  • 首页
  • Java
  • Jersey
  • Jira
  • Confluence
  • U.S.
    • USRealEstate
    • USVisaTrack
    • H1B
  • 项目和网站
    • CWIKI.US
    • OSSEZ 社区
    • WIKI.OSSEZ.COM
    • BUG.OSSEZ.COM
    • RSS.OSSEZ.COM
BLOG.OSSEZ.COM
A responsive blog theme focused om user reading experience
  1. Home
  2. Computer Science
  3. Spring
  4. This article

Spring Batch JSON 支持

2019年01月18日 992Browse 0Like 0Comments

Spring Batch 4.1 开始能够支持 JSON 格式了。这个发布介绍了一个新的数据读(item reader)能够读取一个 JSON 资源,这个资源按照下面的格式:

[
  {
    "isin": "123",
    "quantity": 1,
    "price": 1.2,
    "customer": "foo"
  },
  {
    "isin": "456",
    "quantity": 2,
    "price": 1.4,
    "customer": "bar"
  }
]

 

与针对 XML 的 StaxEventItemReader 类似,新的 JsonItemReader 使用流 API(streaming APIs)来读取 JSON 对象到块中。Spring Batch 能够支持下面 2 个库:

  • Jackson
  • Gson

如果你还希望添加其他的库的话,你可以实现 JsonObjectReader  接口。

JSON 数据的写是通过 JsonFileItemWriter 来支持的。

有关更多 JSON 数据的支持,请参考 ItemReaders and ItemWriters 章节中的内容。

https://www.cwiki.us/display/SpringBatchZH/JSON+support

Tags: Spring Spring Batch
Last updated:2019年01月20日

Kratos

stay absorbed stay excellent

Like
< Previous
Next >

Comments

Cancel reply

Newest Hotspots Random
Newest Hotspots Random
1月14号的 UA857 PowerShell 中运行 maven 参数无法识别 Java 8 使用 Stream 把 List 转换为 map FAA 真的应该换换系统了 说说这 48 小时核酸检测的时间 Jenkins 构建过程中提示 GPG 错误
美联航悄然在 2023 年恢复前往中国航班美联储在加息的路上一路狂奔2023 年美国住房买家的购买意愿HAVC 无电池温控器(Thermostat)的电源接线方法ChatGPT 使用 API 进行 Postman 调用测试ChatGPT 最近火得不要不要的
Confluence 6 配置 HTTP 超时设置 房地产经纪人为什么会给你设置邮件更新 Confluence 6 在数据源连接中启用校验查询 美国房地产交易留置权(Lien)都有什么类型 OpenSearch 文档中文本地化 Confluence 7 编辑文件
Categories
  • Algorithm(算法)
  • AMQP
  • Angular
  • CI
  • Compile And CI
  • Computer Science
  • Confluence
  • DataBase
  • Gradle
  • H1B
  • Hibernate
  • IDE
  • Java
  • Jersey
  • Jira
  • MariaDB
  • PrestaShop
  • Spring
  • Spring Batch
  • U.S.
  • USRealEstate
  • USVisaTrack
  • 我的小厨

COPYRIGHT © 2020 HoneyMoose. ALL RIGHTS RESERVED.

THEME CWIKIUS.CN MADE BY VTROIS