I have generated an Excel file using Apache POI API and trying to send it to remote directory using Spring Integration, but when I am writing below code giving compile time error because its only support "File" type object Excel type is "HSSFWorkbook".
HSSFWorkbook workbook = gerateExcelFile(data);
excelCollector.add((workbook);
and using below code for "inbound-channel-adaptor"
<inbound-channel-adapter id="excelAdapter" auto-startup="true"
ref="excelCollector" method="poll" channel="excelInputChannel">
<poller fixed-rate="500"/>
</inbound-channel-adapter>
The framework does not know how to process arbitrary objects.
You either need to write the workbook to a
File
or convert it to a byte[] containing the workbook contents, and send that.