Official Java SDK for the ThreadSync enterprise data integration API.
Preview: SDKs are in preview and installed from GitHub via JitPack. Maven Central packages will be available at GA.
// Add JitPack repository
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.threadsync-infrastructure:threadsync-java:main-SNAPSHOT'
}<!-- Add JitPack repository -->
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.threadsync-infrastructure</groupId>
<artifactId>threadsync-java</artifactId>
<version>main-SNAPSHOT</version>
</dependency>import io.threadsync.sdk.ThreadSync;
import io.threadsync.sdk.models.*;
public class QuickStart {
public static void main(String[] args) {
// Initialize the client
ThreadSync ts = ThreadSync.builder()
.bearerToken(System.getenv("THREADSYNC_API_TOKEN"))
.build();
// Connect to Salesforce
Connection sf = ts.connections().create("salesforce");
// Connect to your data warehouse
Connection dest = ts.connections().create("snowflake");
// Create a real-time sync
Sync sync = ts.sync().create(
SyncConfig.builder()
.source(new Endpoint(sf.getId(), "Contact"))
.destination(new Endpoint(dest.getId(), "contacts"))
.schedule("realtime")
.build()
);
System.out.printf("Sync created: %s%n", sync.getId());
}
}ThreadSync ts = ThreadSync.builder()
.bearerToken("sk_test_...") // API key or JWT from /v1/auth/token
.baseUrl("https://api.threadsync.io") // Default
.connectTimeout(Duration.ofSeconds(10))
.readTimeout(Duration.ofSeconds(30))
.build();try {
Connection conn = ts.connections().get("conn_nonexistent");
} catch (ThreadSyncException e) {
System.err.println("Code: " + e.getCode()); // NOT_FOUND
System.err.println("Message: " + e.getMessage()); // Connection not found
System.err.println("Request ID: " + e.getRequestId()); // req_...
}MIT - see LICENSE for details.