-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support an Abstract(Reactive)MessageHandler#handleMessageInternal that will accept List<Message<?>> #3797
Comments
Well, that's not how messaging works. Does it make sense? |
I agree with the idea. I think that there's should be some util funciton that accept A problem that currently can occur with the current architecture is that there are headers in the |
@pojacks , did you see my explanation above why it is not like that and why it cannot be implemented as an out-of-the-box feature? |
@artembilan yes I do understand this, but the framework still can supply some opinionated utils. Anyway, what do you think about the use case of the need for the By saying channel adapters that except My use case is that I put the Reactor Kafka's Or is there any other way of committing to Kafka that maybe I should use? |
Well, that info still can be stored in the
That Anyway I see your point and I'm sure that this But again: this is not what could look like a general |
I still think that it is not the messaging abstraction responsibility to be aware of the target handler expectations.
So, I'm going to fix the
For extra option where we won't split, but rather emit a single message with the whole released group. The possible end-user POJO method for similar scenario is able to deal with The So, downstream POJO method could have an argument like What else am I missing from your use-cases, please? |
@artembilan @pojacks I’m not so sure how does the current error handlers work, but doesn’t it just create a new This interesting conversation becomes a little out of scope of this issue (that tries to emphasize the need for supporting bulk operations (and if not as the parameter, so maybe by examples in the docs). Another point I think that’s relevant for this conversation is that the docs aren’t clear when it comes to the error handling part. I think the responses you’ll both give about the error handling should be added to the docs. And as I’ve said about the bulks support, the docs lack with example for error handling. I’d really like to see an error handler example here. @artembilan anyway I think you suggestion for the return type of the aggregations is a good idea (and should appear in the docs). |
Right. I'll document the feature for an aggregator. If your original message has a payload as |
Fixes spring-projects#3797 * Handle `Message` items of the `Iterable` payload properly in the `JdbcMessageHandler`. Otherwise, they've been wrapped into an extra `Message` * Produce a single message with a `Collection<Message<?>>` payload in the `AggregatingMessageHandler` when the `getOutputProcessor()` is not an instance of `SimpleMessageGroupProcessor` * Mention these changes in docs * Point to the error handling sample from docs
* GH-3797: Improve batch processing in the framework Fixes #3797 * Handle `Message` items of the `Iterable` payload properly in the `JdbcMessageHandler`. Otherwise, they've been wrapped into an extra `Message` * Produce a single message with a `Collection<Message<?>>` payload in the `AggregatingMessageHandler` when the `getOutputProcessor()` is not an instance of `SimpleMessageGroupProcessor` * Mention these changes in docs * Point to the error handling sample from docs * * Fix language in docs Co-authored-by: Gary Russell <grussell@vmware.com> Co-authored-by: Gary Russell <grussell@vmware.com>
Expected Behavior
I'd like there to be an interface called
Abstract(Reactive)BulkMessageHandler
which will have ahandleMessageInternal
that will acceptList<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 acceptsMessage<?>
. In the (low number of) channel adapters that supports bulks in Spring Integration, there's a check forinstance of List
or something similar, since they expectMessage<List<?>>
. This prevents me from using headers in myMessage<?>
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 toList<Message<?>>
, I can hack and create a new message ofMessage<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.
The text was updated successfully, but these errors were encountered: