# Java LedgerAPI - LedgerConfigurationService.getLedgerConfiguration() never finishes

**URL:** <https://forum.canton.network/t/java-ledgerapi-ledgerconfigurationservice-getledgerconfiguration-never-finishes/2070>\
**Category:** App Development\
**Tags:** ledger-api\
**Created:** [February 11, 2021, 5:11am UTC](https://forum.canton.network/t/java-ledgerapi-ledgerconfigurationservice-getledgerconfiguration-never-finishes/2070 "2021-02-11T05:11:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zoraizmahmood](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/zoraizmahmood/32/1401_2.png) [@zoraizmahmood](https://forum.canton.network/u/zoraizmahmood)\
**Post date:** [February 11, 2021, 5:11am UTC](https://forum.canton.network/t/java-ledgerapi-ledgerconfigurationservice-getledgerconfiguration-never-finishes/2070/1 "2021-02-11T05:11:06Z")

</div>

Hey everyone, me again,

Just having some issues with the LedgerConfigurationService. I’m trying to get the deduplication time of the ledger as below:

```java
  public void getLedgerConfiguration() {
    try {
      Flowable<LedgerConfigurationServiceOuterClass.LedgerConfiguration> configuration;
      // Assume that ledgerConfigurationClient is already initialized using `damlLedgerClient.getLedgerConifigurationClient()
      configuration = ledgerConfigurationClient.getLedgerConfiguration();
      configuration.blockingForEach(
          con -> {
            LOGGER.info("LedgerConfiguration is {}", con);
          });
      LOGGER.info("Finished GetLedgerConfig");
    } catch (Exception ex) {
      LOGGER.error("Error returning ledger configuration {}", ex.getMessage());
    }
  }

```

Now, I’m simply logging the ledgerConfiguration, which works fine as below:

```haskell
16:00:19.907 [main] INFO c.a.d.i.t.u.s.LedgerConfigurationService - LedgerConfiguration is max_deduplication_time {
  seconds: 86400
}

```

However, it stalls after this and never returns. Now I understand that in a blockingForEach, it only terminates when: `Note: the method will only return if the upstream terminates or the current thread is interrupted.`. However, it seems like in this case, the upstream should terminate after returning the max\_deduplication\_time, which is currently the only returned field in the LedgerConfigurationService. I have tested this on the Sandbox, the Sandbox with static time, and DAML on VMWare.

Let me know if this is a bug, or if I’ve done something wrong in my implementation.

Thank you!

---

<div class="post-metadata">

**Author:** ![bernhard](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/bernhard/32/356_2.png) [@bernhard](https://forum.canton.network/u/bernhard)\
**Post date:** [February 11, 2021, 8:07am UTC](https://forum.canton.network/t/java-ledgerapi-ledgerconfigurationservice-getledgerconfiguration-never-finishes/2070/2 "2021-02-11T08:07:30Z")

</div>

The `LedgerConfigurationService` is a streaming service. [The docs](https://docs.daml.com/app-dev/grpc/proto-docs.html#ledgerconfigurationservice) state

> LedgerConfigurationService allows clients to subscribe to changes of the ledger configuration.

> Returns the latest configuration as the first response, and publishes configuration updates in the same stream.

So you shouldn’t expect it to terminate. If you just want the latest configuration, you’ll need to cancel the subscription after the first response.
