1

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.
Marcus Adams
  • 53,009
  • 9
  • 91
  • 143
John Rix
  • 6,271
  • 5
  • 40
  • 46

1 Answers1

2

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.

Yuval
  • 7,987
  • 12
  • 40
  • 54
  • Thanks Ester. I've been looking at the 9.6 docs rather than 9.7 (not intentionally, but largely thanks to Google!) so missed the dynamic template definition feature. The other option looks feasible also, though I think the first is my preference on balance. – John Rix May 23 '14 at 11:55