VMware
 

Knowledge Base

Search the Knowledge Base:

Products:
Search In:
 

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.

  1. Use WaitForUpdates to collect information about properties, specifically the latestPage on ManagedObject EventHistoryCollector property.

  2. 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:

    1. Waits for an update.

    2. Hands the update, when it comes in, to a different thread.

    3. Returns to waiting for updates.

  3. 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

Virtual Center, SDK, API, ESX

Feedback

Rating: 1 - Lowest 2 3 4 5 - Highest (0 Ratings)   

Did this article help you?
This article resolved my issue.
This article did not resolve my issue.
This article helped but additional information was required to resolve my issue.
What can we do to improve this information? (2000 or fewer characters)
Submit
Rating: 1 - Lowest 2 3 4 5 - Highest (0 Ratings)   
Actions