sqlobjecttimestampgigaspaces

Aging of objects in Gigaspaces


I'm fairly new to Gigaspaces. I am using a polling container to fetch events from a space and then dispatch these over a HTTPS connection. If the server endpoint for the connection becomes unavailable, I need to update the state of the event objects to 'blocked' and re-queue them in the space for later retries (for which I have a separate polling container that specifically looks for the blocked events).

What I'm struggling with is finding a good way to ensure the blocked event polling container does not over-rotate on the blocked events (that is, read the events, discover that the endpoint is still blocked, write them back to the space and then immediately re-read them).

Is there a way I could build in a delay in re-reading the events from the space. Options might include:

  1. Setting/updating a timestamp on the object before writing it back, and then comparing this with the current time within the polling process (for this, I expect I would have to use a SQLQuery which includes SYSDATE as the EventTemplate, but would I have to query SYSDATE out of the space every time I want to update the object rather than using System.currentTimeMillias or equivalent, in order to ensure I am comparing apples to apples?)
  2. Applying a configuration setting of some kind on the blocked event polling container or listener that causes it to only poll periodically.

Solution

  • You can use both approach:

    1. docs.gigaspaces.com/xap97/polling-container.html#dynamic-template-definition
    2. docs.gigaspaces.com/sbp/dynamic-polling-container-templates-using-triggeroperationhandler.html

    In the future, for GigaSpaces related questions, please use: ask.gigaspaces.org/questions/

    Thanks, Ester.