Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Datahub project Datahub RestEmitterConfig

From Leeroopedia
Revision as of 14:44, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Datahub_project_Datahub_RestEmitterConfig.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Knowledge Sources
Domains Java_SDK, Metadata_Emission, REST_API
Last Updated 2026-02-10 00:00 GMT

Overview

An immutable Lombok-based configuration class that holds connection and HTTP settings for the REST-based metadata emitter, including server URL, authentication token, timeouts, retry policy, and HTTP client customization.

Description

RestEmitterConfig is a Lombok @Value/@Builder class that encapsulates all settings for the REST emitter. It configures how the SDK communicates with the DataHub GMS REST API over HTTP.

Key configuration fields:

  • server -- GMS server URL (default: http://localhost:8080).
  • token -- Authentication bearer token (default: null, no auth).
  • timeoutSec -- Optional per-request timeout override.
  • disableSslVerification -- Disables SSL certificate checks (default: false).
  • disableChunkedEncoding -- Disables HTTP chunked transfer encoding (default: false).
  • maxRetries -- Maximum retry count for failed requests (default: 0).
  • retryIntervalSec -- Interval between retries in seconds (default: 10).
  • extraHeaders -- Additional HTTP headers as a string map (default: empty).
  • eventFormatter -- Formatter for converting MCP wrappers (default: Pegasus JSON).
  • asyncIngest -- Controls async ingestion mode on the server side (default: null).
  • asyncHttpClientBuilder -- Pre-configured Apache HttpAsyncClientBuilder with default user agent, connection timeout (10s), response timeout (10s), and retry strategy.

The builder provides:

  • with() -- Functional-style builder chaining via a Consumer.
  • customizeHttpAsyncClient() -- Allows direct customization of the underlying HttpAsyncClientBuilder.

Client version is auto-detected from the client.properties classpath resource.

Usage

Use this configuration class when setting up a REST-based metadata emitter. Override the defaults for production environments that require authentication, custom timeouts, SSL configuration, or retry policies.

Code Reference

Source Location

metadata-integration/java/datahub-client/src/main/java/datahub/client/rest/RestEmitterConfig.java

Signature

@Value
@Builder
public class RestEmitterConfig {
    public static final int DEFAULT_CONNECT_TIMEOUT_SEC = 10;
    public static final int DEFAULT_READ_TIMEOUT_SEC = 10;
    public static final String DEFAULT_AUTH_TOKEN = null;
    public static final String CLIENT_VERSION_PROPERTY = "clientVersion";

    @Builder.Default String server = "http://localhost:8080";
    Integer timeoutSec;
    @Builder.Default boolean disableSslVerification = false;
    @Builder.Default boolean disableChunkedEncoding = false;
    @Builder.Default int maxRetries = 0;
    @Builder.Default int retryIntervalSec = 10;
    @Builder.Default String token = DEFAULT_AUTH_TOKEN;
    @Builder.Default @NonNull Map<String, String> extraHeaders = Collections.EMPTY_MAP;
    @Builder.Default EventFormatter eventFormatter =
        new EventFormatter(EventFormatter.Format.PEGASUS_JSON);
    @Builder.Default Boolean asyncIngest = null;
    HttpAsyncClientBuilder asyncHttpClientBuilder;

    public static class RestEmitterConfigBuilder {
        public RestEmitterConfigBuilder with(
            Consumer<RestEmitterConfigBuilder> builderFunction);
        public RestEmitterConfigBuilder customizeHttpAsyncClient(
            Consumer<HttpAsyncClientBuilder> asyncClientBuilderFunction);
    }
}

Import

import datahub.client.rest.RestEmitterConfig;

I/O Contract

Inputs

Field Type Default Description
server String "http://localhost:8080" DataHub GMS server URL
token String null Bearer authentication token
timeoutSec Integer null (uses defaults) Per-request timeout in seconds
disableSslVerification boolean false Whether to skip SSL certificate verification
disableChunkedEncoding boolean false Whether to disable HTTP chunked transfer encoding
maxRetries int 0 Maximum number of retry attempts for failed requests
retryIntervalSec int 10 Seconds between retry attempts
extraHeaders Map<String, String> empty map Additional HTTP headers
asyncIngest Boolean null Controls async ingestion mode on the server

Outputs

An immutable RestEmitterConfig instance used to construct the REST emitter.

Usage Examples

// Default configuration for local development
RestEmitterConfig config = RestEmitterConfig.builder().build();

// Production configuration with auth and retries
RestEmitterConfig config = RestEmitterConfig.builder()
    .server("https://datahub.example.com:8080")
    .token("eyJhbGciOi...")
    .maxRetries(3)
    .retryIntervalSec(5)
    .extraHeaders(Map.of("X-Custom-Header", "value"))
    .build();

// Custom HTTP client settings
RestEmitterConfig config = RestEmitterConfig.builder()
    .server("https://datahub.example.com:8080")
    .customizeHttpAsyncClient(builder ->
        builder.setMaxConnTotal(50))
    .build();

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment