Knowledge Base

Search the Knowledge Base: |
Search the Knowledge Base: |
Getting Events or Notifications of Events as They Occur
Details
I am interested in getting events or notifications of events, as they occur. There is an operation to go and collect events but that means that I have to poll periodically to get later events. How can I collect events and notifications without manually polling?
Solution
Use the WaitForUpdates option to collect events and notifications.
WaitForUpdates works only for properties of ManagedObjects.
In the case of Events, WaitForUpdates can be used to get updates on latestPage property of the EventManager ManagedObject.
-
Use WaitForUpdates to collect information about properties, specifically the latestPage on ManagedObject EventHistoryCollector property.
-
Put the WaitForUpdates in a separate thread.
Using a separate thread minimizes the time between receiving an event notice and waiting for the next event. WaitForUpdates:-
Waits for an update.
-
Hands the update, when it comes in, to a different thread.
-
Returns to waiting for updates.
-
- Using the setCollectorPageSize method, set the page size to accommodate the expected flow of events.
Using latestPage returns all the events on the latest page.
If you have the page size set too low for common event traffic, the client application might miss events. For example, if the page size is 10, and 30 events are generated on the server, then the client application does not see the first 20 events.
Note: In the EventHistoryCollector, you can set the maximum number of events in the latestPage by calling the SetCollectorPageSize method.
Keywords
Feedback
- KB Article: 1002651
- Updated: Aug 14, 2009
- Products:
VMware Infrastructure SDK - Product Versions:
VMware Infrastructure SDK 2.0.x

