Question

We have an issue currently where we have setup our WCF service to connect to a tibco EMS server. When running the service in single instance mode (we cant change this due to the way the application runs) it will always acknowledge 2 messages first even though it has only processed one - this is leading to some messages being skipped.

[ServiceBehavior(
    ConcurrencyMode = ConcurrencyMode.Single,
    InstanceContextMode = InstanceContextMode.Single,
    Namespace = "http://tempuri.org/test")]
public class MyService : IMyService

I have stepped through the Tibco EMS WCF code and can see that there are 2 messages in the underlying TIBCO.EMS.Session class in the private _deliveredList field, both are marked with requiring ACK even though I have only processed one message. It doesn't seem to matter how many messages are on the queue, if the length is greater than one it will always double acknowledge.

I have applied throttling with the following configuration but it did not seem to have any affect to the number of initial messages that were sent.

Any help would be very much appreciated.

Was it helpful?

Solution

It looks like it is just a poor implementation by Tibco with the WCF component when handling CLIENT_ACKNOWLEDGE. Due to the fact that the session object is abstracted you cant really ACK for things you dont have access to.

Options are as follows:

  • Set the pre-fetch setting on the queue to 1
  • Use EXPLICIT_CLIENT_ACKNOWLEDGE

There is also a gotcha where if you throw an exception without a ACK it will get stuck on the queue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top