Click or drag to resize
SessionSubscribe Method (IListSubscription, Identity, String, SubscriptionPreprocessMode)
Initiates a request to receive asynchronous updates to the specified topics in the subscriptionList.

Namespace:  Bloomberglp.Blpapi
Assembly:  Bloomberglp.Blpapi (in Bloomberglp.Blpapi.dll) Version: 3.24.6.1
Syntax
public IList<SubscriptionPreprocessError> Subscribe(
	IList<Subscription> subscriptionList,
	Identity identity,
	string requestLabel,
	SubscriptionPreprocessMode mode
)

Parameters

subscriptionList
Type: System.Collections.GenericIListSubscription
A list of subscription strings to subscribe.
identity
Type: Bloomberglp.BlpapiIdentity
The handle to the user for whom this subscription is being initiated.
requestLabel
Type: SystemString
A label that defines a string which will be recorded along with any diagnostics for this operation.
mode
Type: Bloomberglp.BlpapiSubscriptionPreprocessMode
Determines how to preprocess subscriptions. Refer to SubscriptionPreprocessMode for an explanation of the available modes.

Return Value

Type: IListSubscriptionPreprocessError
A list of SubscriptionPreprocessErrors or a null list depending on mode. Refer to SubscriptionPreprocessMode for more details.

Implements

ISessionSubscribe(IListSubscription, Identity, String, SubscriptionPreprocessMode)
Exceptions
ExceptionCondition
ArgumentExceptionidentity was not created through this Session, or subscriptionList is null or empty, or the mode is FailOnFirstError and the SubscriptionString of an entry in the subscriptionList is invalid.
DuplicateCorrelationIDException The mode is FailOnFirstError and the CorrelationID of an entry in the subscriptionList is not unique.
InvalidOperationException The session is not started.
Remarks

Once this has method has returned any subscriptions in subscriptionList which were not given an application generated CorrelationID will have a session generated CorrelationID set. Multiple subscriptions to the same subscription string are valid and each will have their own, unique CorrelationID. This method should only be called after the Session has successfully started up. If an exception is thrown none of the subscriptions in the list would have been processed.

If identity is not null, the subscription request is issued on behalf of the user represented by identity. Use SendAuthorizationRequest(Request, Identity, CorrelationID) to authorize an user for accessing the specified service.

Upon completion of this request a SUBSCRIPTION_STATUS event will be published for each topic in the subscription list containing a message with the result for each topic. A SubscriptionStarted message will be generated if the subscription was successfully initiated. If the subscription fails for any topic a SubscriptionFailure message containing the failure reason will be generated.

See Also