Home Help Center

Tips to achieve exactly-once semantics?

ramonramon Member Ramon SchwammbergerOrganization: Open Systems AGProject: alert system
Hi,

I use Ice and glacier2 to transport alerts from clients to a server. We all know that Ice provides "at-most-once" semantics for delivering messages.

I can easily get "at-least-once" semantics by re-queuing every message that produced an Ice::TimeoutException.

Is there a clever way to get "exactly-once" semantics? Using "at-least-once" semantics and filtering out duplicate messages at the server does not sound clever to me.

Cheers
Ramon

Comments

  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    What is the problem you want to solve? Is it if you send the request and get a failure (ie: an exception) you want to know whether the request was actually executed by the server?
  • ramonramon Member Ramon SchwammbergerOrganization: Open Systems AGProject: alert system
    Yes, that might help. This is only an issue if the network is really bad and connections are lost on a regular basis.

    Currently, I re-queue the message if a TimeoutConnection was thrown. But this results naturally in duplicated messages in networks with poor connectivity. I would like to get rid of the duplicated messages. Do you have any advice?
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    The only way to avoid the duplicated messages is to add support for it in the server. Either the server drops duplicated messages or it provides an interface for the client to query whether or not a given request was dispatched. Without help from the server, the client can't figure out if a request was dispatched or not: it can't figure out if the failure is because the request never reached the server or if it's because the reply was lost on its way back to the client.

    Cheers,
    Benoit.
  • ramonramon Member Ramon SchwammbergerOrganization: Open Systems AGProject: alert system
    Thank you Benoit and Matthew! This is what I needed to know.

    Cheers
    Ramon
Sign In or Register to comment.