SessionSubscribe Method (IListSubscription, Identity, String, SubscriptionPreprocessMode) |
Namespace: Bloomberglp.Blpapi
public IList<SubscriptionPreprocessError> Subscribe( IList<Subscription> subscriptionList, Identity identity, string requestLabel, SubscriptionPreprocessMode mode )
Exception | Condition |
---|---|
ArgumentException | identity 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. |
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.