Search code examples
c#.netsolace

Solace Provision Flag Set


I am trying to provision a queue in solace as in here by using

// Provision it, and do not fail if it already exists
session.Provision(queue, endpointProps,
ProvisionFlag.IgnoreErrorIfEndpointAlreadyExists & ProvisionFlag.WaitForConfirm, null);
Console.WriteLine("Queue '{0}' has been created and provisioned.", queueName);

However even though I set the flag to ProvisionFlag.WaitForConfirm as in the sample I am still getting ReturnCode In_Progress which means provision is not blocking as expected and also provision error that queue alread exist. any reason why?


Solution

  • I found out that the documentation for Solace on Github is wrong. Instead of using the & operator it should be |.

    Updated that to use | like

    // Provision it, and do not fail if it already exists
    session.Provision(queue, endpointProps,
    ProvisionFlag.IgnoreErrorIfEndpointAlreadyExists | ProvisionFlag.WaitForConfirm, null);
    Console.WriteLine("Queue '{0}' has been created and provisioned.", queueName);
    

    And it works.