10.26.0

ISessionCreateFlow(FlowProperties, IEndpoint, ISubscription, EventHandlerMessageEventArgs, EventHandlerFlowEventArgs) Method

Creates IFlow instances. A flow is an API concept, which allows client applications to consume messages from an IEndpoint. Messges are 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).

Definition

Namespace: SolaceSystems.Solclient.Messaging
Assembly: SolaceSystems.Solclient.Messaging (in SolaceSystems.Solclient.Messaging.dll) Version: 10.26.0
C#
IFlow CreateFlow(
	FlowProperties flowProperties,
	IEndpoint endPoint,
	ISubscription subscription,
	EventHandler<MessageEventArgs> messageEventHandler,
	EventHandler<FlowEventArgs> flowEventHandler
)

Parameters

flowProperties  FlowProperties
FlowProperties
endPoint  IEndpoint
The IEndpoint instance to bind the new IFlow to.
subscription  ISubscription
Only valid if endpoint is of type ITopicEndpoint.
messageEventHandler  EventHandlerMessageEventArgs
The message EventHandler delegate.
flowEventHandler  EventHandlerFlowEventArgs
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

IFlow
An IFlow instance that's already started, unless FlowStartState is set to false.

Exceptions

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