Customize retry Handler Middleware
Currently while using middlewate I use this code to get the default lit of middlewares.
defaultClientOptions := msgraph.GetDefaultClientOptions() defaultMiddleWare := msgraphgocore.GetDefaultMiddlewaresWithOptions(&defaultClientOptions)
However, I am not sure how to override the Retry handler alone in this list of middlewares.
Looking for an example to do this/
Hi @ritu-rubrik, thanks for trying out the SDK. If you would like to override the Retry handler, you are able to do it when executing the command i.e here is an example. You will only need to provide the retry option in the request configuration
retryHandlerOptions := nethttplibrary.RetryHandlerOptions{
ShouldRetry: func(delay time.Duration, executionCount int, request *http.Request, response *http.Response) bool {
return false
},
}
opts := applications.ApplicationsRequestBuilderGetRequestConfiguration{
QueryParameters: &applications.ApplicationsRequestBuilderGetQueryParameters{
Select: []string{"displayName", "appId", "id", "keyCredentials", "passwordCredentials"},
Top: to.Ptr[int32](100),
},
Options: []abstractions.RequestOption{&retryHandlerOptions},
}
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.