10.24.0

IMessageDispatcherCreateDispatchTarget Method

Creates a IDispatchTarget instance to be used in the Subscribe(IDispatchTarget, Int32, Object) and Unsubscribe(IDispatchTarget, Int32, Object) methods.

Note: Client applications must keep IDispatchTarget object references accessible if they want to Unsubscribe from the given IMessageDispatcher, and remove already added Topic subscriptions. IDispatchTarget internal object ID constitutes a unique key. Forgetting to keep a reference to IDispatchTarget objects make subsequent Unsubscribe(IDispatchTarget, Int32, Object) calls impossible.

Definition

Namespace: SolaceSystems.Solclient.Messaging
Assembly: SolaceSystems.Solclient.Messaging (in SolaceSystems.Solclient.Messaging.dll) Version: 10.24.0
C#
IDispatchTarget CreateDispatchTarget(
	ISubscription subscription,
	EventHandler<MessageEventArgs> messageCallback
)

Parameters

subscription  ISubscription
An ITopic instance.
messageCallback  EventHandlerMessageEventArgs
The callback delegate to dispatch matching messages to.

Return Value

IDispatchTarget
Returns a IDispatchTarget instance

Exceptions

ObjectDisposedException Thrown when the session is already disposed (terminal state).
ArgumentNullException Thrown if subscription or messageCallback are null.
ArgumentOutOfRangeException

See Also