arrowhead-f / arrowhead-kalix

The Arrowhead Kalix Libraries
https://arkalix.se
Eclipse Public License 2.0
2 stars 5 forks source link

Consume all services from query #18

Closed jaivgar closed 3 years ago

jaivgar commented 4 years ago

Hello,

I was looking at the ServiceQuery#using() to check if there was a similar method to consume all the services from the ServiceQuery. The idea is that there are several Arrowhead systems providing the same service, although I was not I could not find such a method, and I am not sure how it could be done.

Looking at: https://github.com/arrowhead-f/arrowhead-kalix/blob/3cfba1f56f1130c768620fec60ff920385dfb157/kalix-base/src/main/java/se/arkalix/query/ServiceQuery.java#L377

I though could be changed to something like:

return resolveAll().map(services -> {
            services.forEach(service -> factory.create(consumer, service, encodings));
        });

But not sure how the return type can be modified to work as the original method for integration with the library.

Regards,

emanuelpalm commented 4 years ago

I know the people at Xarepo have requested a similar feature before. I'll look into it later.

emanuelpalm commented 3 years ago

This exists now since version 0.5.0 and onwards.

See ServiceQuery#resolveAll() and ServiceQuery#allUsing().