Questions tagged [itemwriter]

ItemWriter is a basic interface for generic output operations in Spring Batch. (This tag must be used only with spring-batch posts)

ItemWriter is a basic interface for generic output operations in Spring Batch.

51 questions
1
vote
0 answers

Spring Batch : How does ClassifierCompositeItemWriter decide whether to create a new writer or use an existing one?

Given a Spring Batch job that uses chunk oriented processing, I have a requirement to write the same data to different files depending on the value of an attribute. In other words, I need the output file name be decided at runtime depending on the…
Ping
  • 587
  • 5
  • 27
1
vote
1 answer

Spring Batch FlatFileItemWriter write Object with List

I have a Pojo Partner: Partner Id List Address Pojo : AddressId, Address, City, Country, Pin I want to create a Flat file in Spring Batch - File will be : PartnerId;AddressId;Address;City;Country;Pin I am getting Partner Pojo with Id and List of…
Nikhil Nadkar
  • 43
  • 2
  • 11
0
votes
1 answer

Clarification needed with Spring batch concepts

I am new at Spring batch and I am having an issue implementing my business use case with Spring batch. Basically, I am reading data from a database i.e. a List of subscribers to a newsletter. I then need to send an email to each subscriber as well…
balteo
  • 23,602
  • 63
  • 219
  • 412
0
votes
0 answers

Write multiple groups/batch with header and trailer using spring batch

I want to generate a file with financial transactions similar to the following format. Basically transactions are grouped by merchant and currency. Each group has a separate header and trailer. FILE_HEADER MERCHANT_AND_CURRENCY_HEADER …
0
votes
1 answer

Itemwriter method close exception status of batch completed (not failed)

An exception in an ItemWriter#close method is not causing the exit status to be marked as FAILED. Can you confirm that is the expected behavior ? According to my understanding, when ItemWriter#close method is called, the items must have been…
buck
  • 31
  • 3
0
votes
1 answer

Spring batch: multiple operations in writer

In a spring batch project I have to implement multiple operations in a writer: call two different APIs and update a local database. The point is: if one of these operations fails I need to restart from the failed one, without repeating the…
Pirulino
  • 758
  • 1
  • 9
  • 20
0
votes
1 answer

Spring Batch JpaItemWriter performance

I use spring batch JpaItemWriter to insert db with 11500 records(8 columns for that table), and I thought its performance will be good, but it was not as fast as I expected. 11500 records took about 60 seconds with chunk size 100, then I raise the…
dandelion
  • 5
  • 4
0
votes
0 answers

Spring batch itemwriter interface

The write method of Itemwriter has been changed in the spring version 5. @Override public void write(List> items) throws Exception{ for(List sublist:items){ writer.write(sublist); } The above writer is…
arun
  • 23
  • 4
0
votes
0 answers

Spring Batch FlatFileItemWriter

salve sto cercando di leggere u oggetto e scivere un oggetto ma ricevo un errore : Invalid property 'KDE22' of bean class [com.Bnl.Wl.Batch2.Model.EmployeeOut]: Bean property 'KDE22' is not readable or has an invalid getter method: Does the return…
0
votes
1 answer

How to use MongoItemWriter to write a List

My processor return a List of Object but I don't find a solution to override the MongoItemWriter to write some List of object and not object. I tried this. My processor : @Override public List process(PlaqueSousSurveillanceEntity…
jenoh
  • 165
  • 3
  • 17
0
votes
1 answer

How do I get inserted key in ItemWriter to use it in another query Spring Batch

I am using Spring Batch, and I will do an Insert in ItemWriter and need to do an update in another table with the key inserted. How do I get the key to use it in the updateTableB ? Thank you in advance. @Bean public CompositeItemWriter
LTurTk
  • 25
  • 3
0
votes
0 answers

How to write file with dynamic number of files in spring batch?

I'm new in spring batch and very need your help. How can I writing file in spring batch, which can be write dynamically number of files. How data looks like, in attachmentdata: So, in here I need to generate files, which classify based on "DayNo",…
0
votes
1 answer

Spring batch not running ItemProcessor and ItemWriter

I got issue in Spring batch while running job. I've configured my ItemReader, ItemProcessor, ItemWriter in 3 different files and then trying to run them in step but after ItemReader nothing executes. Below are all my files. package…
cruey
  • 1
  • 1
0
votes
1 answer

Write the same data with different file names using single Item writer using Spring Batch

I have a Spring Batch FlatFileItemWriter which writes data to a specific location with a file name(let's say A.txt for example). Now I need the same file to be written with different file name (let's say B.txt) . How can I achieve this with a single…
0
votes
2 answers

Rollback or Reset a BufferedWriter

A logic that handles the rollback of a write to a file is this possible? From my understanding a BufferWriter only writes when a .close() or .flush() is invoked. I would like to know is it possible to, rollback a write or undo any changes to a file…