Questions tagged [itemprocessor]
ItemProcessor is an interface for item transformation in Spring Batch applications. Given an item as input, this interface provides an extension point which allows for the application of business logic in an item oriented processing scenario. (This tag must be used only with spring-batch posts)
20
questions
33
votes
5
answers
46k
views
Spring Batch: One reader, multiple processors and writers
In Spring batch I need to pass the items read by an ItemReader to two different processors and writer. What I'm trying to achieve is that...
+---> ItemProcessor#1 ---> ...
22
votes
4
answers
31k
views
Return multiple items from spring batch ItemProcessor
I'm writing a spring batch job and in one of my step I have the following code for the processor:
@Component
public class SubscriberProcessor implements ItemProcessor<NewsletterSubscriber, Account&...
2
votes
1
answer
1k
views
Multiple ItemProcessors and ItemWriters in the same Spring Batch step
Can I write a Spring Batch step with a single ItemReader and multiple substeps, each with an ItemProcessor followed by a ItemWriter?
I am trying to achieve something like this:
ItemReader ---> item ...
2
votes
2
answers
2k
views
Can I use FlatFileItemWriter to write multi-format file in Spring Batch?
I'm reading a multi-format file using FlatFileItemReader and mapping every line to its corresponding bean type in ItemProcessor and performing data enrichment. But when I try to write these records ...
1
vote
1
answer
878
views
Why is exception in Spring Batch AsycItemProcessor caught by SkipListener's onSkipInWrite method?
I'm writing a Spring Boot application that starts up, gathers and converts millions of database entries into a new streamlined JSON format, and then sends them all to a GCP PubSub topic. I'm ...
1
vote
1
answer
599
views
Access Job Parameter in Custom ItemProcessor
I am implementing a custom ItemProcessor<I, O> in spring batch for processing data from a Rest api .
I want access some values from jobParameter inside my ItemProcessor class .
Any suggestion on ...
1
vote
1
answer
1k
views
Pass filenames dynamically to FlatFileItemWriter through StepBuilderFactory stream() when using ClassifierCompositeItemProcessor in SpringBatch
I'm processing multiple input files with multi-format lines using ClassifierCompositeItemProcessor. But when using StepBuilderFactory stream to write the files, I'm unable to pass the Resource ...
1
vote
1
answer
1k
views
NullPointerException when trying to read Database Queries in spring batch ItemProcessor
public class TransactionHistoryCsvItemProcessor implements ItemStream, ItemProcessor<TransactionHistory,TransactionHistory>{
@Autowired
private ...
1
vote
1
answer
240
views
Spring Batch partition doesnt work composite itemprocessor
I have a Spring Batch partition job. I’m using CompositeProcessor, read data from DB and save these items into an CopyOnWriteArrayList. Because the environment is concurrent but my ...
1
vote
1
answer
2k
views
Spring Batch: Multithreaded step with AsyncItemProcessor doesn't run in parallel
TL;DR
Given a file with a million reocrds where there is considerable amount of logic to be executed on each row in the file, what is the fastest way to read the file and finish applying the logic on ...
0
votes
1
answer
492
views
Spring-batch ItemProcessor data in the form of a list to model
I'm using a custom itemReader to read data from an external rest API, and it's working great. However, the problem arises when processing the data with ItemProcessor into my model class. Unfortunately,...
0
votes
1
answer
1k
views
How to know if it is the last item in ItemProcessor of SpringBatch
I have the following ItemProcessor, I need to know if the item is the last item the reader sends. Is this possible?
The flow is:
ItemReader - read lines from database (expected millions of lines)
...
0
votes
1
answer
333
views
Spring Batch @BeforeContext Fails to Execute
I have a situation in spring batch where I have multiple item processors that make up a composite item processor. I need to share some context data between two processors in the same step. I have ...
0
votes
1
answer
468
views
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 ...
0
votes
0
answers
28
views
spring batch issues : split my output into differents files
Hi everyone im pretty new with spring and spring batch. I have a file in input with multiple row and data. I want to redirect the row in a specific file depending to the data in the row. Its something ...
0
votes
0
answers
25
views
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.
...
0
votes
1
answer
914
views
Updating a processed item in Spring Batch
I have a Spring Batch app that uses ItemProcessor to process items.
@Component
@StepScope
public class MemberProcessor<T> implements ItemProcessor<T, Member> {
@Override
public ...
0
votes
0
answers
958
views
Spring Batch + MongoItemReader, ItemProcessor, MongoItemWriter + not reading all records
I'm using Spring Batch with Mongo database.
I need to get the documents based on status (status=PENDING), write in a Kafka queue and update documents field with new status(status=FILLED).
So I used a ...
0
votes
2
answers
861
views
To separate steps class in spring batch
I have tried to find the solution but I cannot... ㅠㅠ
I want to separate steps in a job like below.
step1.class -> step2.class -> step3.class -> done
The reason why I'm so divided is ...
0
votes
0
answers
209
views
Generate new Items / CSV-Rows in Spring Batch Processor in Batch Job
Summary : I need to export some CSV Files with Rows that are generated during Batch export.
I already do have an JdbcItemreader to get the Data from my DB. The Processor formats the OutputData to the ...