@ExecutorRemotingMethod(broadcast = true)
void save(@Routing(" [*].getRouting ") Collection<MyPojo> objects);
Then ExecutorSpaceRemotingProxyFactoryBean would split the collection, and send only the objects to the partition that each belongs to.
the customer is looking for something that groups the objects based on their routing, and then sends each subcollection to the partition it belongs to analogous to how gigaSpace.writeMultiple(...) splits up the objects based on their routing.
Another use-case would be:
@ExecutorRemotingMethod(broadcast = true, reducer = ListReducer.class)
List<MyPojo> getByIds(@Routing(" [*] ") Collection<Long> ids);
Say you only ask for 10 objects from 40 partitions (a use-case we had). Then we could save a lot of unnecessary network calls if only the partitions that have those objects are being called.
I implemented this myself using a client invocation aspect, but it got really messy. I had to trick ExecutorSpaceRemotingProxyFactoryBean into doing async calls by generating an interface at runtime and juggle with classloaders. Plus I had to implement code for handling routing and reducers myself. This is why I feel that this feature should be implemented in XAP.