ctrlx-automation-sdk icon indicating copy to clipboard operation
ctrlx-automation-sdk copied to clipboard

Subscription - keepAliveInterval is reached

Open rureverek opened this issue 9 months ago • 0 comments

I have small issue when working with Subscription feature. I realised that after keepAliveinterval specified in SubscriptionProperties, my Subscription gets flooded by notifications even that data didn't changed...

Is it possible to turn off notifications (publishCallback()) when keepAliveinterval is reached?

I'm using the code similar to one i tutorial:

  flatbuffers::FlatBufferBuilder builder;
  auto dataChange = comm::datalayer::CreateSampling(builder, 2500);
  auto rule = comm::datalayer::CreateProperty(builder, comm::datalayer::Properties::Properties_Sampling, dataChange.Union());
  auto rules = builder.CreateVector(&rule, 1);
  auto idTmp = builder.CreateString(id);
  builder.Finish(comm::datalayer::CreateSubscriptionProperties(builder, idTmp, 60000, 1000, rules));
  comm::datalayer::Variant subscriptionProperties;
  subscriptionProperties.shareFlatbuffers(builder);

  auto result = m_datalayerClient->createSubscriptionSync(subscriptionProperties, publishCallback());

I would like to have notification only when data is changed, and in the case keepAliveInterval is reached I don't want to have any publishCallback().

rureverek avatar May 16 '24 18:05 rureverek