Closed ksharma96 closed 1 year ago
Hi @ksharma96, you can manually instantiate the http client and pass it to NotionClient constructor like it does here: https://github.com/seratch/notion-sdk-jvm/blob/v1.8.0/core/src/main/kotlin/notion/api/v1/NotionClient.kt#L20
Thanks for asking this! Since I've provided an answer to your question, let me close this issue now.
Thanks for the prompt response!
Hey @seratch - the only way exposed in Java to set the client is via setHttpClient method as shown below.
Also, the constructor only takes a string as the input for the token in Java.
So as of now, I'm not able to manually instantiate the http client and pass it to the Constructor, can you please help with some inputs as to what I can do about this? I just want to set the connect_timeout and read_timeout to my customized values.
@ksharma96 Here is an example:
package example;
import notion.api.v1.NotionClient;
import notion.api.v1.http.HttpUrlConnNotionHttpClient;
public class Test {
public static void main(String[] args) {
NotionClient client = new NotionClient();
client.setHttpClient(new HttpUrlConnNotionHttpClient(
10_000,
60_000
));
}
}
We ran into an issue with an on prem server. It takes > 3 seconds in some situations to connect to the Notion endpoints and the SDK throws a Null Pointer Exception. Have a look at the logs below:
Can the SDK's NotionClient/NotionHttpClient expose some way to configure the below two properties please @seratch ?
These reside inside the
class HttpUrlConnNotionHttpClient
. Would love to have raised a pull request for the same myself, but am just not familiar with Kotlin. Cheers.