データクライアント StreamApi

StreamApiストリーム REST API をミラーリングします。

カタログに保存されているレイヤーおよびパーティションに関する情報(メタデータ)を取得できます。

StreamApiのすべての仕様については 、 StreamApi を参照してください。

次のページで は、リクエストごとの設定メトリックについて説明します。

Scala
Java
val client = BaseClient()
val streamApi = client.of[StreamApi]

val someHrn = "hrn:here:data::olp-here-test:whatever"
val someLayer = "whateverLayer"
val someSubscriptionId = "subscription-xyz-123"
val result: Future[ConsumerSubscribeResponse] =
  streamApi
    .subscribe(
      hrn = someHrn,
      layerId = someLayer,
      subscriptionId = Some(someSubscriptionId)
    )
    .executeToEntity()

result
  .andThen {
    case Success(response) =>
      // do something with the subscription response
      println(
        s"node base url for subscription ${response.subscriptionId.get} is ${response.nodeBaseURL.get}")
    case Failure(ex) =>
      ex.printStackTrace()
  }

Await.result(result, Duration.Inf)
BaseClient client = BaseClientJava.instance();
StreamApi streamApi = new StreamApi(client);

String someHrn = "hrn:here:data::olp-here-test:whatever";
String someLayer = "whateverLayer";
String someSubscriptionId = "subscription-xyz-123";

ConsumerSubscribeResponse result =
    streamApi
        .subscribe()
        .withHrn(someHrn)
        .withLayerId(someLayer)
        .withSubscriptionId(Optional.of(someSubscriptionId))
        .build()
        .executeToEntity()
        .toCompletableFuture()
        .join();

// do something with the subscription response
System.out.printf(
    "node base url for subscription %s is %s\n",
    result.getSubscriptionId().get(), result.getNodeBaseURL().get());

」に一致する結果は 件です

    」に一致する結果はありません