Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/Java gRPC client - How to close a DamlLedgerClient properly?Forum ↗

Java gRPC client - How to close a DamlLedgerClient properly?

App Development3 posts306 views1 likesLast activity Mar 2022
JA
jaypeedaOP
Mar 2022

Hi team,

What is the good approach to close properly a DamlLedgerClient object in Java application ?

Best regards,
Jean-Paul

ST
stefanobaghino-da
Mar 2022

Using the .close() method should be the right way to do it, possibly in a finally block. Unfortunately DamlLedgerClient doesn’t implement neither Closeable nor Autocloseable but if you prefer to use Java’s try-with-resources statement you can add a wrapper around it.

JA
jaypeeda
Mar 2022

Noted with thanks !

← Back to Discussions