I wanted a single reader two processor and two writer. my processing logic is correct but this is my composite writer-
“`
@Bean
public CompositeItemWriter compositeItemWriterr() {
CompositeItemWriter writer = new CompositeItemWriter<>();
writer.setDelegates( Arrays.asList(
(ItemWriter) classifierCompositeItemWriter(null),
(ItemWriter) schNamesWriter()
)
);
return writer;
}
```
Both schNamesWriter and classifierCompositeItemWriter have diffrent types So i am getting error here while adding it in delegate So I am using typecast. I guess this may be the issue because if i add only one specific type then data is being persisited in db.
public CompositeItemWriter<ScheProInfo> compositeItemWriterr() {
CompositeItemWriter<ScheProInfo> writer = new CompositeItemWriter<>();
writer.setDelegates( Arrays.asList(
classifierCompositeItemWriter(null)
)
);
return writer;
}
Can please anyone suggest how can I use two different type of writers here.
I have tried single type and data is being persisted but the issue is when adding two different types. Please let me know if more info is required.
ANUPAM is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.