Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting a FabricElementAlreadyExistsException on ServiceRemotingMessageHeaders.AddHeader() #280

Open
wouterroos opened this issue Jul 9, 2021 · 1 comment

Comments

@wouterroos
Copy link

Hi,

I have the following implementation of IServiceRemotingClient to add a header to the IServiceRemotingRequestMessage instance:

public class SetOperationContextServiceRemotingClient : IServiceRemotingClient
{
    //other IServiceRemotingClient members ommitted for brevity

    public Task<IServiceRemotingResponseMessage> RequestResponseAsync(IServiceRemotingRequestMessage requestRequestMessage)
    {
        var message = //build message
        
        requestRequestMessage.GetHeader().AddHeader("MyMessageHeader", Encoding.ASCII.GetBytes(message));
        return InnerClient.RequestResponseAsync(requestRequestMessage);
    }
}    

This works perfectly in all our tests and local cluster but recently we occasionally get a FabricElementAlreadyExistsException which states: 'Header with name 'MyMessageHeader' already exists'. This issue seems to occur when the call to the service fails due to some reason so my guess is that a retry mechanism is at work here. Is this correct, and if so, should I implement IServiceRemotingClient.RequestResponseAsync() to be idempotent to prevent this issue?

Thanks!

@wouterroos
Copy link
Author

Hi,

Could someone provide some feedback on this issue?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant