# Daml Java Bindings: Use of Flowable vs Single (ex: Get Users vs Get Packages)

**URL:** <https://forum.canton.network/t/daml-java-bindings-use-of-flowable-vs-single-ex-get-users-vs-get-packages/4709>\
**Category:** App Development\
**Created:** [June 10, 2022, 6:24pm UTC](https://forum.canton.network/t/daml-java-bindings-use-of-flowable-vs-single-ex-get-users-vs-get-packages/4709 "2022-06-10T18:24:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![StephenOTT](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stephenott/32/3953_2.png) [@StephenOTT](https://forum.canton.network/u/StephenOTT)\
**Post date:** [June 10, 2022, 6:24pm UTC](https://forum.canton.network/t/daml-java-bindings-use-of-flowable-vs-single-ex-get-users-vs-get-packages/4709/1 "2022-06-10T18:24:40Z")

</div>

I notice some differences in the return types of some of the clients in the Java bindings:

Example: using `ledgerClient.packageClient.listPackages()` returns a Flowable but running `ledgerClient.userManagementClient.listUsers()` returns a Single.

Is this by design? why is list of packages a publisher of flowable but users returning a single?

Thanks!

---

<div class="post-metadata">

**Author:** ![stefanobaghino-da](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stefanobaghino-da/32/7057_2.png) [@stefanobaghino-da](https://forum.canton.network/u/stefanobaghino-da)\
**Post date:** [June 13, 2022, 8:25am UTC](https://forum.canton.network/t/daml-java-bindings-use-of-flowable-vs-single-ex-get-users-vs-get-packages/4709/2 "2022-06-13T08:25:37Z")

</div>

At its core, the client libraries exposed by the Java bindings are a bit more high-level than the callback-based gRPC-generated code. Still, they are a relatively thin shim. This means that when the Ledger API returns a stream, an RxJAva `Flowable` is returned by the Java bindings and when a single result is returned instead an RxJava `Single` is returned. The user management API has been designed more recently (it’s part of the Ledger API only since 2.0) and followed slightly different design patterns (presented [here](https://cloud.google.com/apis/design/design_patterns#list_pagination)) than the package management API, which results in this discrepancy.

---

<div class="post-metadata">

**Author:** ![StephenOTT](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stephenott/32/3953_2.png) [@StephenOTT](https://forum.canton.network/u/StephenOTT)\
**Post date:** [June 13, 2022, 3:29pm UTC](https://forum.canton.network/t/daml-java-bindings-use-of-flowable-vs-single-ex-get-users-vs-get-packages/4709/3 "2022-06-13T15:29:28Z")

</div>

@stefanobaghino-da is the bindings supposed to be updated with pagination support? ListUsers() does not seem to support passing the ListUsersRequest object:

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/daml/original/2X/8/8f73869d2017d499b56d323715d13c446dcf327e.png)

---

<div class="post-metadata">

**Author:** ![stefanobaghino-da](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stefanobaghino-da/32/7057_2.png) [@stefanobaghino-da](https://forum.canton.network/u/stefanobaghino-da)\
**Post date:** [June 13, 2022, 4:23pm UTC](https://forum.canton.network/t/daml-java-bindings-use-of-flowable-vs-single-ex-get-users-vs-get-packages/4709/4 "2022-06-13T16:23:40Z")

</div>

Thanks for letting us know, I checked the implementation and this looks like a bug. Based on what I found you should be able to retrieve the first 1000 users as that is the default page size in the implementation, but without a token that’s the maximum extent to which you can go. I opened [this ticket](https://github.com/digital-asset/daml/issues/14165) to keep track of the issue.

---

<div class="post-metadata">

**Author:** ![StephenOTT](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stephenott/32/3953_2.png) [@StephenOTT](https://forum.canton.network/u/StephenOTT)\
**Post date:** [June 13, 2022, 4:25pm UTC](https://forum.canton.network/t/daml-java-bindings-use-of-flowable-vs-single-ex-get-users-vs-get-packages/4709/5 "2022-06-13T16:25:30Z")

</div>

Great thanks
