none
Azure EventHub - How to remove the event? RRS feed

  • Question

  • Like allways, I would appreciate your help, as I am currently stuck!!!

    We have a new project and we will be using the Azure EventHub. I have created demo app, where we can add events to the Event Hub and also where we can consume them using IEventProcessor(Receiver project). The questions is that every time, I execute the receiver project, I see the same events. Shouldn't we expect that those events will be deleted-removed after we consume them?

    Example in the Receiver project:

    foreach (EventData eventData in messages)
    {
            string data = Encoding.UTF8.GetString(eventData.GetBytes());
    
            Console.WriteLine(string.Format("Message received.  Partition: '{0}', Data: '{1}'",
                    context.Lease.PartitionId, data));
    }

    Is there a way to delete/remove the event after the Console.WriteLine or will the message be retained for a day? With the Queues , you can signal the completion , but with the EventHub is don't see any command, I can use to delete/remove it.

    Any reply would be greatly appreciated. We have been instructed to use EventHub but a-b reasons, its not a matter of choice.

    Thursday, November 6, 2014 1:59 PM

Answers

All replies

  • EventHub is an event streaming solution. You need to keep track of a cursor at the client so you can start your receiver whereever you left. Have you considered ServiceBus Queues/Topics solution since you seem to have in need for a "consume and delete" data programming model?

    Friday, November 7, 2014 12:12 AM
  • Events are aged off Event Hubs - not deleted by users. Serkant's advice is good for deciding your platform.
    Wednesday, November 12, 2014 5:49 PM