-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Expected Behavior
I'd like there to be an interface called Abstract(Reactive)BulkMessageHandler
which will have a handleMessageInternal
that will accept List<Message<?>>
.
Current Behavior
Most data flows these days are getting written with bulk-based data interactions. Spring Integration is awesome since it lets the user work with stream-based data and process messages one by one. But when it comes to writing the data to the databases, most people would want their application to have a sain performance and therefore they'll want to reduce the number of network requests, by using bulk writes/updates/ upserts. This is the ideal way for writing data in like 90% of the applications (except for Kafka which will do it itself/ S3 which is another story). Therefore I'd like a nice way of writing bulk data to data sources. The outbound channel adapter's interface these days has the Abstract(Reactive)MessageHandler#handleMessageInternal
function, which accepts Message<?>
. In the (low number of) channel adapters that supports bulks in Spring Integration, there's a check for instance of List
or something similar, since they expect Message<List<?>>
. This prevents me from using headers in my Message<?>
since I want (and I guess most of the applications are the same) the headers to get added for each message. After I'm grouping to List<Message<?>>
, I can hack and create a new message of Message<List<Message<?>>>
. But I think it's ugly and looks like an effort for just using the interface, instead of adding another interface.
Context
I'd like to use and write bulk channel adapters.