Home
Administer community queued events
Use the CommunitiesQEventService commands to administer the life-cycle events that occur within a community.
To use administrative commands, use wsadmin. See Start wsadmin for details.
When a community member makes a change in a community, for example, if they add a new feature to the community or change the privacy level of the community, remote applications can choose to be notified of this change by an event. If the remote application is unavailable or is otherwise unable to process the event, the event is stored in a queue. When the IBM WebSphere Application Server scheduler runs the LifeCycleRetryQueuedEvents task, the event is processed. However, if, for some reason, you don't want to wait for the scheduled task, you can manage these queued events manually by running the CommunitiesQEventService commands.To administer the queued events associated with a community...
- Start wsadmin so that you can access the Communities configuration files.
- Access the Communities configuration files:
- Stand-alone deployment:
execfile("communitiesAdmin.py")
- Network deployment:
execfile("WAS_HOME/communities/Dmgr01/config/bin_lc_admin/communitiesAdmin.py")
If you are asked to select a server, you can select any server.
- Use the following commands to administer queued events.
- To retrieve a list of the events currently queued for processing, use the following commands:
CommunitiesQEventService commands for listing queued events
Option Description CommunitiesQEventService.viewQueuedEventsSummary() Lists a summary of all of the events that are currently queued for processing. CommunitiesQEventService.viewQueuedEventsByResourceType(String resourceType, HashMap lastEvent, int maxRows) Lists queued events with the specified resource type, where:
- resourceType is the string "community"
- lastEvent specifies the last row of the previous batch. This is a HashMap object. To obtain the first batch, specify None.
- maxRows is the number of rows to be retrieved and viewed with a single command. Use maxRows when there is a large number of rows, 200, for example, to break up both the database reads and the display into batches.
For example:
CommunitiesQEventService.viewQueuedEventsByResourceType("community", None, 100)
This command returns a HashMap that is the last viewed row. When there are no more rows, the value None is returned. This makes it straightforward to loop over all rows a few rows at a time. For example, you might use the following Jython code to display all queued events of resourceType community in batches of 10 when there are 200 events:
lastRow = CommunitiesQEventService.viewQueuedEventsByResourceType(“community”, None, 10) while (lastRow != None) lastRow = CommunitiesQEventService.viewQueuedEventsByResourceType(“community”, lastRow, 10)
CommunitiesQEventService.viewQueuedEventsByResourceId(String resourceType, String resourceId, HashMap lastEvent, int maxRows) Lists queued events with the specified resource type and resource ID, where:
- resourceType is the string "community"
- resourceId is the communityUuid. This is a string.
- lastEvent is a HashMap object
- maxRows is the number of rows to be retrieved and viewed with a single command. Use maxRows when there is a large number of rows, 200, for example, to break up both the database reads and the display into batches.
This command returns a HashMap, which is the last viewed row. When there are no more rows, the value None is returned. This makes it straightforward to loop over all rows a few at a time. For example, you might use the following Jython code to display all queued events of resourceType "community" and resourceId b46300c7-7837-4ba3-b26b-3fcf67a75bba, in batches of 10 when there are 200 entries:
lastRow = CommunitiesQEventService.viewQueuedEventsByResourceId(“community”, None, b46300c7-7837-4ba3-b26b-3fcf67a75bba, 10) while (lastRow != None) lastRow = CommunitiesQEventService.viewQueuedEventsByResourceId(“community”, None, b46300c7-7837-4ba3-b26b-3fcf67a75bba, 10)
CommunitiesQEventService.viewQueuedEventsByRemoteAppDefId(String remoteAppDefId, HashMap lastEvent, int maxRows) Lists queued events associated with the specified remote application ID, where:
- remoteAppDefId is one of the following: Activities, Blog, Files, Wiki. The first character in the string must be formatted in uppercase.
- lastEvent specifies the last row of the previous batch. This is a HashMap object. To obtain the first batch, specify None.
- maxRows is the number of rows to be retrieved and viewed with a single command. Use maxRows when there is a large number of rows, 200, for example, to break up both the database reads and the display into batches.
This command returns a HashMap that is the last viewed row. When there are no more rows, the value None is returned. This makes it straightforward to loop over all rows a few at a time. For example:
CommunitiesQEventService.viewQueuedEventsByRemoteAppDefId("Blog", None, 100)Thus, to display all queued events of resourceType "community" in batches of 10, when there are 200 entries, you might code in Jython:
lastRow = CommunitiesQEventService.viewQueuedEventsByRemoteAppDefId(“Activities”, None, 10) while (lastRow != None) lastRow = CommunitiesQEventService. viewQueuedEventsByRemoteAppDefId(“Activities”, lastRow, 10)
- Use the following commands to retry events that have failed to process:
CommunitiesQEventService commands for retrying queued events
Option Description CommunitiesQEventService.retryQueuedEventsByResourceType(String resourceType) Retries queued events with the specified resource type, where resourceType is a string. The value of resourceType is always "community". The return value is either 1 or 0. 1 indicates success; 0 indicates failure. For example:
CommunitiesQEventService.retryQueuedEventsByResourceType("community")
CommunitiesQEventService.retryQueuedEventsByResourceId(String resourceType, String resourceId) Retries queued events with the specified resource type and resource ID, where resourceType and resourceId are both strings. The return value is either 1 or 0. 1 indicates success; 0 indicates failure. For example:
CommunitiesQEventService.retryQueuedEventsByResourceId("community", "e952cf0c-a86c-4e26-b1e0-f8bf40a75804")
CommunitiesQEventService.retryQueuedEventsByRemoteAppDefId(String remoteAppDefId) Retries queued events with the specified associated application ID, where remoteAppDefId is one of the following: Activities, Blog, Files, Wiki. The first character of the string must be formatted in uppercase. The return value is either 1 or 0. 1 indicates success; 0 indicates failure. For example:
CommunitiesQEventService.retryQueuedEventsByRemoteAppDefId("Wiki")
- Use the following commands to clear the queue of events waiting to be processed. For example, if your organization has communities that have activities associated with them and you uninstall the Activities feature from your deployment, you need to purge Activities events so that they aren't perpetually retried. Use these commands with care.
CommunitiesQEventService commands for clearing queued events
Option Description CommunitiesQEventService.clearQueuedEventsByResourceType(String resourceType) Clears queued events with the specified resource type, where resourceType is a string. The return value is the number of events that were cleared. For example:
CommunitiesQEventService.clearQueuedEventsByResourceType("community")
CommunitiesQEventService.clearQueuedEventsByResourceId(String resourceType, String resourceId) Clears queued events with the specified resource ID, where resourceType and resourceId are both strings. The return value is the number of events that were cleared. For example:
CommunitiesQEventService.clearQueuedEventsByResourceId("community", "e952cf0c-a86c-4e26-b1e0-f8bf40a75804")
CommunitiesQEventService.clearQueuedEventsByRemoteAppDefId(String remoteAppDefId) Clears queued events with the specified associated application ID, where remoteAppDefId is one of the following: Activities, Blog, Files, Wiki. The first character of the string must be formatted in uppercase. The return value is the number of events that were cleared. For example:
CommunitiesQEventService.clearQueuedEventsByRemoteAppDefId("Wiki")
CommunitiesQEventService.clearQueuedEventByEventId(String eventId) Clears queued events with the specified event ID, where eventId is a string. The return value is the number of events that were cleared. For example:
CommunitiesQEventService.clearQueuedEventsByEventId("2d93497d-065a-4022ae25-a4b52598d11a")
Example
Here are some examples of queued event commands and their output.viewQueuedEventsSummary()wsadmin>CommunitiesQEventService.viewQueuedEventsSummary() App Def Id Number Events Earliest Created Activities 1 2009-03-28 11:56:44.453 Blog 1 2009-03-28 11:56:44.453 Files 2 2009-03-28 11:56:44.453 Wiki 2 09-03-28 11:56:44.453 {NumEvents=2, RemoteAppDefId=Wiki, EarliestCreated=2009-03-28 11:56:44.453} wsadmin>
viewQueuedEventsByResourceType
wsadmin>CommunitiesQEventService.viewQueuedEventsByResourceType("community", None, 100) Remote App Resource Id Event Type Event Id Blog e952cf0c-a86c-4e26-b1e0-f8bf40a75804 community.visibility.changed 47362aa9-dfd7-43d4-bf42-3b069b0cbbbf Files e952cf0c-a86c-4e26-b1e0-f8bf40a75804 community.updated 7685892-d8a8-4563-a433-1392b8b58e01 Wiki e952cf0c-a86c-4e26-b1e0-f8bf40a75804 community.updated dccb0a7d-d6d4-4daa-9c03-6658a57631d0 Activities e952cf0c-a86c-4e26-b1e0-f8bf40a75804 community.visibility.changed 3a4f2d84-8d7f-4a40-bc3c-36e02e9bb97b Files e952cf0c-a86c-4e26-b1e0-f8bf40a75804 community.visibility.changed 92c9f965-a8a3-481e-a0d4-0fdb856bb875 Wiki e952cf0c-a86c-4e26-b1e0-f8bf40a75804 community.visibility.changed ff635551-c59e-4ee7-b10f-0ca6e210c318 {ResourceId=e952cf0c-a86c-4e26-b1e0-f8bf40a75804, ManAppDefId=Wiki, ResourceType=1, Inserted=2009-03-28 15:57:26.000, EventId=ff635551-c59e-4ee7-b10f-0ca6e210c318, EventType=community.visibility.changed, InsertedLong=1238270246000} wsadmin>
viewQueuedEventsByRemoteDefAppId
wsadmin>CommunitiesQEventService.viewQueuedEventsByRemoteAppDefId("Activities", None, 100) Resource Type Id Resource Id Event Type Event Id 1 e952cf0c-a86c-4e26-b1e0-f8bf40a75804 community.visibility.changed 3a4f2d84-8d7f-4a40-bc3c-36e02e9bb97b {ResourceId=e952cf0c-a86c-4e26-b1e0-f8bf40a75804, RemAppDefId=Activities, ResourceType=1, Inserted=2009-03-28 15:57:25.873, EventId=3a4f2d84-8d7f-4a40-bc3c-36e02e9bb97b, EventType=community.visibility.changed, InsertedLong=1238270245873}
viewQueuedEventsByRemoteAppDefId
wsadmin>CommunitiesQEventService.viewQueuedEventsByRemoteAppDefId("Wiki", None, 100) Resource Type Id Resource Id Event Type Event Id 1 e952cf0c-a86c-4e26-b1e0-f8bf40a75804 community.updated dccb0a7d-d6d4-4daa-9c03-6658a57631d0 1 e952cf0c-a86c-4e26-b1e0-f8bf40a75804 community.visibility.changed ff635551-c59e-4ee7-b10f-0ca6e210c318 {ResourceId=e952cf0c-a86c-4e26-b1e0-f8bf40a75804, RemAppDefId=Wiki, ResourceType=1, Inserted=2009-03-28 15:57:26.000, EventId=ff635551-c59e-4ee7-b10f-0ca6e210c318, EventType=community.visibility.changed, InsertedLong=1238270246000} wsadmin>
viewQueuedEventsByRemoteAppDefId
wsadmin>CommunitiesQEventService.viewQueuedEventsByRemoteAppDefId("Blog", None, 100) Resource Type Id Resource Id Event Type Event Id 1 e952cf0c-a86c-4e26-b1e0-f8bf40a75804 community.visibility.changed 47362aa9-dfd7-43d4-bf42-3b069b0cbbbf {ResourceId=e952cf0c-a86c-4e26-b1e0-f8bf40a75804, RemAppDefId=Blog, ResourceType=1, Inserted=2009-03-28 15:57:21.450, EventId=47362aa9-dfd7-43d4-bf42-3b069b0cbbbf, EventType=community.visibility.changed, InsertedLong=1238270241450} wsadmin>
viewQueuedEventsByResourceId
wsadmin>CommunitiesQEventService.viewQueuedEventsByResourceId("community", "e952cf0c-a86c-4e26-b1e0-f8bf40a75804", None, 100) Remote App Resource Id Event Type Event Id Blog e952cf0c-a86c-4e26-b1e0-f8bf40a75804 community.visibility.changed 47362aa9-dfd7-43d4-bf42-3b069b0cbbbf Files e952cf0c-a86c-4e26-b1e0-f8bf40a75804 community.updated f7685892-d8a8-4563-a433-1392b8b58e01 Wiki e952cf0c-a86c-4e26-b1e0-f8bf40a75804 community.updated dccb0a7d-d6d4-4daa-9c03-6658a57631d0 Activities e952cf0c-a86c-4e26-b1e0-f8bf40a75804 community.visibility.changed 3a4f2d84-8d7f-4a40-bc3c-36e02e9bb97b Files e952cf0c-a86c-4e26-b1e0-f8bf40a75804 community.visibility.changed 92c9f965-a8a3-481e-a0d4-0fdb856bb875 Wiki e952cf0c-a86c-4e26-b1e0-f8bf40a75804 community.visibility.changed ff635551-c59e-4ee7-b10f-0ca6e210c318 {ResourceId=e952cf0c-a86c-4e26-b1e0-f8bf40a75804, ManAppDefId=Wiki, ResourceType=1, Inserted=2009-03-28 15:57:26.000, EventId=ff635551-c59e-4ee7-b10f-0ca6e210c318, EventType=community.visibility.changed, InsertedLong=1238270246000} wsadmin>
Administer remote applications
Related tasks