Description
Hello,
I've created a POC to illustrate a potential issue. It seems like entities are not being batched for subscriptions.
In this POC, an integration test defines a bean that counts how many times the @BatchMapping method is invoked it is currently failing. For subscriptions, the method is called once per entity that triggers the batch mapping, rather than batching as expected. In contrast, batching works correctly for queries, as confirmed by both logs and the integration test.
The project uses an Owner entity with two associated entities: one is batch-mapped and the other is schema-mapped. When executing the "owners" query, the batch-mapped method is called only once, while the schema-mapped method is called 10 times (once per owner), which should be expected.
However, when performing the "allOwners" subscription with the same schemaMappings and batchMappings, the batch-mapped method is called 10 times instead of batching. Is this the expected behaviour?
The POC is available here
In the end I would think that it would batch the entities in both the requests, being them queries or subscriptions.
Thank you so much for your time.