ISession.CreateFlow Method (FlowProperties, IEndpoint, ISubscription, EventHandler(MessageEventArgs), EventHandler(FlowEventArgs))

Solclient

ISessionCreateFlow Method (FlowProperties, IEndpoint, ISubscription, EventHandlerMessageEventArgs, EventHandlerFlowEventArgs)
version: 7.2.1.27
Creates IFlow instances. A flow is an API concept, which allows client applications to consume messages off an IEndpoint attracted by a ISubscription to a IDestination.

The message receive delegate is invoked for each received message on this flow. The flow event delegate is invoked when flow events occur, such as the flow going up or down. Both delegates are invoked in the context of the context thread to which this session belongs.

Note: disposing the corresponding context (IContext) or any of its contained context timers (TimerTask), sessions (ISession) or flows (IFlow) must not be performed from within the registered delegates (messageEventHandler or flowEventHandler).

An endpoint is a holding area which allows a client to attract Guaranteed messages matching a given subscription to a destination. There are two types of endpoints: "durable" and "non-durable". Durable in this context means that the client that is bound to the given endpoint does not have to be online to attract messages. Non-durable endpoints are disposed when the bound client disconnects.

A destination can be either temporary or non-temporary. A temporary destination is used as a "reply to" field in request/reply message exchange patterns. Wildcard subscription capabilities do not apply to temporary destinations.

With the exception of durable endpoint with temporary destination, the following cases are supported:

use caseendPointsubscription
A flow bound to a non-temporary IQueue.A non-null IQueue, created by CreateQueue(String)null
A flow bound to a temporary IQueue.A non-null IQueue, created by CreateTemporaryQueue.null
A flow bound to a non-temporary ITopic and a durable ITopicEndpoint.A non-null ITopicEndpoint, created by CreateDurableTopicEndpoint(String).A non-null ITopic, created by CreateTopic(String) or CreateTopic(TopicProperties).
A flow bound to a non-temporary ITopic and a non-durable ITopicEndpoint.A Non-Durable ITopicEndpoint, created by CreateNonDurableTopicEndpoint. A non-null ITopic, created by CreateTopic(String) or CreateTopic(TopicProperties).
A flow bound to a temporary ITopic and a non-durable ITopicEndpoint.A Non-Durable ITopicEndpoint, created by CreateNonDurableTopicEndpoint. A non-null ITopic, created by CreateTemporaryTopic or CreateTopic(TopicProperties).
A flow bound to a subscriber endpoint ISubscriberEndpoint. (Supported only when connecting with CRB-equipped appliances.)A non ISubscriberEndpoint, created by CreateSubscriberEndpoint(ISession).null

Namespace: SolaceSystems.Solclient.Messaging
Assembly: SolaceSystems.Solclient.Messaging (in SolaceSystems.Solclient.Messaging.dll) Version: 7.2.1.27 (7.2.1.27)
Syntax
IFlow CreateFlow(
	FlowProperties flowProperties,
	IEndpoint endPoint,
	ISubscription subscription,
	EventHandler<MessageEventArgs> messageEventHandler,
	EventHandler<FlowEventArgs> flowEventHandler
)
Function CreateFlow ( 
	flowProperties As FlowProperties,
	endPoint As IEndpoint,
	subscription As ISubscription,
	messageEventHandler As EventHandler(Of MessageEventArgs),
	flowEventHandler As EventHandler(Of FlowEventArgs)
) As IFlow
IFlow^ CreateFlow(
	FlowProperties^ flowProperties, 
	IEndpoint^ endPoint, 
	ISubscription^ subscription, 
	EventHandler<MessageEventArgs^>^ messageEventHandler, 
	EventHandler<FlowEventArgs^>^ flowEventHandler
)

Parameters

flowProperties
Type: SolaceSystems.Solclient.MessagingFlowProperties
FlowProperties
endPoint
Type: SolaceSystems.Solclient.MessagingIEndpoint
The IEndpoint instance to bind the new IFlow to.
subscription
Type: SolaceSystems.Solclient.MessagingISubscription
Only valid if endpoint is of type ISubscriberEndpoint.
messageEventHandler
Type: SystemEventHandlerMessageEventArgs
The message EventHandler delegate.
flowEventHandler
Type: SystemEventHandlerFlowEventArgs
The flow event EventHandler delegate.

Client applications can call GetLastSDKErrorInfo from within the flow event delegate to get more info on the type of error condition reported by FlowEventArgs.

Return Value

Type: IFlow
An IFlow instance that's already started, unless FlowStartState is set to false.
Exceptions
ExceptionCondition
OperationErrorException Thrown when the operation fails. Possible sub-codes:
ObjectDisposedException Thrown when the session is already disposed (terminal state).
FatalErrorException Thrown when an unrecoverable error occurs.
ArgumentNullException Thrown if any of the required parameters is null.
ArgumentException Thrown if arguments fail validation.
See Also