public interface FlowReceiver extends Consumer
Endpoint on
a Solace appliance. All messages delivered to a Session through a particular
appliance Endpoint are transmitted on a logical flow.
FlowReceiver is acquired from JCSMPSession. When
acquired successfully, an instance of FlowReceiver has a channel
(connection) opened to the appliance, which is shared with other
FlowReceiver instances within the same Session. In general, it
is an expensive operation to acquire a FlowReceiver instance.
Applications must cache this instance, and close it only when it is no longer
needed.
Note: The methods defined in this interface are non-thread-safe,
except the start, stop and close()
methods, which be can called at any time by any thread.
To receive messages, an application must call start() to start
receiving messages from the underlying connection by using either synchronous
receive(...) calls or using asynchronous notification by setting
XMLMessageListener. The received messages are read-only.
The stop() method is used to disable the receiving of messages
on this flow.
Once the close() method is invoked, any further access causes an
exception to be thrown.
A flow can be administratively closed on the appliance, or closed due to an
error condition. Such an event is indicated by throwing on access (or, in the
case of a flow in asynchronous mode, delivering to the
XMLMessageListener) a JCSMPFlowTransportException.
| Modifier and Type | Method and Description |
|---|---|
void |
close(boolean linger)
[SolReserved] Close a flow, optionally signaling a non-durable Endpoint
should linger on the appliance.
|
Destination |
getDestination()
Returns the
Destination to which messages should be
published to get routed to this flow's bound Endpoint. |
Endpoint |
getEndpoint()
Returns the appliance Endpoint this flow is bound to.
|
Subscription |
getSubscription()
Returns the subscription associated to the Endpoint when bound to a
TopicEndpoint. |
void |
logFlowInfo(JCSMPLogLevel level)
Outputs a log containing the flow state
information for the flow at a specified log level.
|
void |
setMessageListener(XMLMessageListener listener) |
close, closeSync, closeSync, receive, receive, receiveNoWait, start, startSync, stop, stopSync, stopSyncStart, stopSyncWaitvoid setMessageListener(XMLMessageListener listener)
void close(boolean linger)
linger is set, the Endpoint will not be destroyed
immediately, but rather only after a appliance-defined timeout.
Unacknowledged messages on the Endpoint will be preserved during this
time.linger - If true, and this flow is bound to a non-durable
Endpoint, signals to the appliance the Endpoint should
not be immediately destroyed.void logFlowInfo(JCSMPLogLevel level)
level - The level (corresponding to
org.apache.commons.logging levels) at which to
output the log.Endpoint getEndpoint()
Subscription getSubscription()
TopicEndpoint.Topic subscription associated to the
TopicEndpoint this flow is bound to, null if
not bound to a TopicEndpoint.Destination getDestination()
Destination to which messages should be
published to get routed to this flow's bound Endpoint.
TopicEndpoint, the
Destination will be of type Topic.Queue, the Destination will
be of type Queue.SubscriberEndpoint, this method returns
null.Destination to which messages should be
published to get routed to this flow's bound
Endpoint.Copyright 2004-2020 Solace Corporation. All rights reserved.