ISession.Subscribe Method (IEndpoint, ISubscription, Int32, Object)

Solclient

ISessionSubscribe Method (IEndpoint, ISubscription, Int32, Object)
version: 7.2.1.27
Add a ITopic subscription on the endpoint if the operation is supported on the endpoint (Only endpoints of type IQueue or type IClientName support this operation).

Namespace: SolaceSystems.Solclient.Messaging
Assembly: SolaceSystems.Solclient.Messaging (in SolaceSystems.Solclient.Messaging.dll) Version: 7.2.1.27 (7.2.1.27)
Syntax
ReturnCode Subscribe(
	IEndpoint endpoint,
	ISubscription subscription,
	int subscribeFlags,
	Object correlationKey
)
Function Subscribe ( 
	endpoint As IEndpoint,
	subscription As ISubscription,
	subscribeFlags As Integer,
	correlationKey As Object
) As ReturnCode
ReturnCode Subscribe(
	IEndpoint^ endpoint, 
	ISubscription^ subscription, 
	int subscribeFlags, 
	Object^ correlationKey
)

Parameters

endpoint
Type: SolaceSystems.Solclient.MessagingIEndpoint
The endpoint to add the subscription on (must be of type IQueue or type IClientName). When authorized, a session can add subscriptions to any queue or to other sessions as identified by ClientName.
subscription
Type: SolaceSystems.Solclient.MessagingISubscription
Only subscriptions of type ITopic are supported
subscribeFlags
Type: SystemInt32
Possible values are: 0, this signals to the API not to request or wait for a confirmation One or more flags from SubscribeFlag ORed. Valid flags are RequestConfirm and WaitForConfirm
correlationKey
Type: SystemObject
If subscribeFlags is RequestConfirm, client applications can specify a non-null correlationKey object reference which is returned to the application as a CorrelationKey field within a SessionEventArgs event.

Return Value

Type: ReturnCode
SOLCLIENT_WOULD_BLOCK or SOLCLIENT_OK or SOLCLIENT_IN_PROGRESS
Exceptions
ExceptionCondition
OperationErrorException Thrown when the Subscribe operation fails, more information will be available in the OperationErrorException fields. Possible sub-codes:
ObjectDisposedException Thrown when the session is already disposed (terminal state).
FatalErrorException Thrown when an unrecoverable error occurs.
ArgumentNullException Thrown if subscription is null.
See Also