arcus-azure / arcus.eventgrid

Azure Event Grid development in a breeze
https://eventgrid.arcus-azure.net/
MIT License
17 stars 6 forks source link

Use WithExponentialRetry with EventGridPublisherBuilder #189

Closed pim-simons closed 2 years ago

pim-simons commented 2 years ago

Description According to the documentation I should be able to use the WithExponentialRetry with the EventGridPublisherBuilder, see: https://eventgrid.arcus-azure.net/features/publishing-events/#resilient-publishing image

However this does not seem to be implemented: image

I tried using both Arcus.EventGrid.All and Arcus.EventGrid.Publishing but unfortunately no luck. What am I doing wrong?

tomkerkhove commented 2 years ago

It should be available in the Arcus.EventGrid.Publishing namespace.

https://github.com/arcus-azure/arcus.eventgrid/search?l=C%23&q=WithExponentialRetry

pim-simons commented 2 years ago

Ah I understand from looking at the unittests, I had to use the interface IEventGridPublisherBuilderWithExponentialRetry like so

private IEventGridPublisherBuilderWithExponentialRetry CreateEventGridBuilder(string topicEndpoint, string endpointKey)
{
    return EventGridPublisherBuilder
        .ForTopic(topicEndpoint)
        .UsingAuthenticationKey(endpointKey);
}

And then refer to that, that wasn't immediately clear to me. But it's working now, thanks!

stijnmoreels commented 2 years ago

@pim-simons yeah, we tried to make a sort of 'guided builder' where you would via intelisense be guided towards the next available option. Something you see often in Microsoft-related frameworks too. Guess isn't as obvious as we thought. ☺️ A good lesson for us.

pim-simons commented 2 years ago

Let me take a look if I can change the documentation a little so that it's a bit clearer maybe, will create a PR for that

stijnmoreels commented 2 years ago

Let me take a look if I can change the documentation a little so that it's a bit clearer maybe, will create a PR for that

Ok, great initiative! πŸ‘ Thx

pim-simons commented 2 years ago

Well it looks like this was just an issue of the problem being between the chair and keyboard. I took another look at it and honestly the documentation is fine, it was me not following it the right way (I was trying to place the WithExponentialRetry before UsingAuthenticationKey which was the issue. My bad πŸ€¦πŸ»β€β™‚οΈ