Newer Version Available
ManagedEventSubscription (Beta)
File Suffix and Directory Location
ManagedEventSubscription components have the suffix .managedEventSubscription and are stored in the managedEventSubscriptions folder.
Version
ManagedEventSubscription components are available in API version 60.0 and later.
Special Access Rules
You must have the Customize Application permission to deploy and retrieve this type.
Fields
| Field Name | Field Type | Description |
|---|---|---|
| defaultReplay | EventSubscriptionReplayPreset (enumeration of type string) | The position in the stream where the subscription starts when the
client initiates the subscription for the first time or if the
client doesn’t commit a Replay ID. Possible values are:
|
| errorRecoveryReplay | EventSubscriptionReplayPreset (enumeration of type string) | The position in the stream where the subscription restarts if the
committed Replay ID is invalid. The Replay ID can be invalid if it’s
older than the event retention window. Possible values are:
|
| label | string | The label for the managed subscription. |
| state | EventSubscriptionAdminState (enumeration of type string) | The execution state that the ManagedSubscribe RPC call consumes. If
state is set to RUN, the subscription starts when the ManagedSubscribe RPC call is made.
Otherwise, the subscription doesn't start. If an administrator later
changes state from RUN to STOP, the
system notifies the Pub/Sub API client of the new
state value and the subscription
disconnects. Also, the stored Replay ID value that was committed
previously is deleted. The next time the ManagedSubscribe RPC call is made after
state is changed from STOP to RUN, the subscription starts from the
defaultReplay value. The possible values for state are:
|
| topicName | string | The topic name of the platform event or change event or the
channel name of a custom platform event channel or custom or
standard change data capture channel. The topic name can be one of
the following values.
|
| version | string | Reserved for internal use. |
Declarative Metadata Sample Definition
The following is an example of a ManagedEventSubscription component with the file name My_Managed_Subscription.managedSubscription.
1<?xml version="1.0" encoding="UTF-8"?>
2<ManagedEventSubscription xmlns="http://soap.sforce.com/2006/04/metadata">
3 <defaultReplay>LATEST</defaultReplay>
4 <errorRecoveryReplay>LATEST</errorRecoveryReplay>
5 <label>My Managed Subscription</label>
6 <state>RUN</state>
7 <topicName>/event/Order_Event__e</topicName>
8</ManagedEventSubscription>The following is an example package.xml that references the previous definition.
1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3 <types>
4 <members>My_Managed_Subscription</members>
5 <name>ManagedEventSubscription</name>
6 </types>
7 <version>65.0</version>
8</Package>Wildcard Support in the Manifest File
This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.