You can read messages from a stream layer if you subscribe to it.
To get data from the stream layer:
For instructions, see Create platform client settings.
StreamLayerClientobject with the HERE Resource Name (HRN) of the catalog that contains the layer, layer ID, and platform client settings from step 1.
olp::dataservice::read::StreamLayerClient client( client::HRN catalog, std::string layer_id, client::OlpClientSettings settings);
SubscribeRequestobject with the
If your application should read smaller volumes of data using a single subscription, use the
If your application should read large volumes of data in a parallel manner, use the
parallelsubscription type and subscription ID.
auto request = olp::dataservice::read::SubscribeRequest() .WithSubscriptionMode(olp::dataservice::read::SubscribeRequest::SubscriptionMode::kSerial));
Subscribemethod with the
client::CancellableFuture<SubscribeResponse> Subscribe( SubscribeRequest request);
You receive a subscription ID from the requested subscription to the selected layer.
You get messages with the layer data and partition metadata. The
Pollmethod also commits the offsets, so you can continue polling new messages.
If the data size is less than 1 MB, the data field is populated. If the data size is greater than 1 MB, you get a data handle that points to the object stored in the blob store.
If the data size is greater than 1 MB, call the
GetDatamethod with the
client::CancellableFuture<DataResponse> GetData( const model::Message& message);
You get data from the requested partition.