- Notifications
You must be signed in to change notification settings - Fork0
Amazon Shipping,FedEx, Usps, Stamps.com Shipping Implementations
License
NotificationsYou must be signed in to change notification settings
easykeys/EasyKeys.Shipping
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
EasyKeys.com production ready shipment library for FedEx, Stamps and USPS shipping providers.
If you like or are using this project please give it a star. Thanks!
- EasyKeys.Shipping.FedEx.Abstractions
- EasyKeys.Shipping.FedEx.AddressValidation
- EasyKeys.Shipping.FedEx.Rates
- EasyKeys.Shipping.FedEx.Shipment
- EasyKeys.Shipping.FedEx.Tracking
- EasyKeys.Shipping.FedEx.Console - Sample Application
- EasyKeys.Shipping.Stamps.Abstractions
- EasyKeys.Shipping.Stamps.AddressValidation
- EasyKeys.Shipping.Stamps.Rates
- EasyKeys.Shipping.Stamps.Shipment
- EasyKeys.Shipping.Stamps.Tracking
- EasyKeys.Shipping.Stamps.Console - Sample application
varrequest=newValidateAddress(model?.RequestId??Guid.NewGuid().ToString(),originalAddress,originalAddress);varresponse=await_policy.ExecuteAsync(async(ctx,ct)=>await_validationProvider.ValidateAddressAsync(request,ct),newContext{[_policyContextMethod]="ValidateAsync"},cancellationToken);privateIAsyncPolicyGetRetryWithTimeOutPolicy(){// each call is limited to 30 seconds in case when fedex is non-reponsive and it is 1min timeout, it is way to long// The request channel timed out attempting to send after 00:01:00.// Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout.vartimeoutPolicy=Policy.TimeoutAsync(30,TimeoutStrategy.Pessimistic);varjitterer=newRandom();returnPolicy.Handle<TimeoutRejectedException>().WaitAndRetryAsync(retryCount:3,// exponential back-off plus some jittersleepDurationProvider:(retryAttempt,context)=>{returnTimeSpan.FromSeconds(Math.Pow(2,retryAttempt))+TimeSpan.FromMilliseconds(jitterer.Next(0,200));},onRetry:(ex,span,context)=>{varmethodName=context[_policyContextMethod]??"MethodNotSpecified";_logger.LogWarning("{Method} wait {Seconds} to execute with exception: {Message} for named policy: {Policy}",methodName,span.TotalSeconds,ex.Message,context.PolicyKey);}).WithPolicyKey($"{nameof(FedExAddressValidationProvider)}WaitAndRetryAsync").WrapAsync(timeoutPolicy);}
About
Amazon Shipping,FedEx, Usps, Stamps.com Shipping Implementations
Topics
Resources
License
Stars
Watchers
Forks
Packages0
No packages published