Azure / azure-event-hubs-c

C client library for Azure Event Hubs https://azure.microsoft.com/services/event-hubs
Other
7 stars 18 forks source link

How to manage the offset on client side to read from the partition. #3

Closed jtaubensee closed 7 years ago

jtaubensee commented 7 years ago

From @sngpt08 on December 22, 2016 11:33

i am using this api to get the data from eventHub EventHubReceiver_ReceiveFromStartTimestampAsync(eventHubReceiveHandle, OnReceiveCB, NULL, OnErrorCB, NULL,now);

here now = time(NULL);

i am storing json string in eventhub. but most of the time my application got crashed because i got some junk char in my json data. but if i change the startTimestamp value it works.

so whats the way to figure out the correct offset value ?

Copied from original issue: Azure/azure-event-hubs#296

mrohera commented 7 years ago

Hello, The API will retrieve all events with start timestamp greater than the specified startTimestampInSec parameter of API EventHubReceiver_ReceiveFromStartTimestampAsync.

Using now = time(NULL) on most platforms will get you the seconds from epoch and this API will communicate with the Event Hub and ask the service to send back any events queued after this second timestamp.

Its not clear to me when you say "if I change the timestamp value it works". Can you elaborate what you mean when you say you changed this value to?

mrohera commented 7 years ago

Are you still experiencing any problems here? If not, I can close this case.

jtaubensee commented 7 years ago

ping @sngpt08