public class ConsumerFlowProperties extends Object
JCSMPSession.createFlow(XMLMessageListener, ConsumerFlowProperties)
.Constructor and Description |
---|
ConsumerFlowProperties()
Creates a new instance of
ConsumerFlowProperties . |
Modifier and Type | Method and Description |
---|---|
void |
addRequiredSettlementOutcomes(XMLMessage.Outcome... requiredOutcomes)
Controls whether a newly created flow is expected to support all specified settlement capability options.
|
String |
getAckMode()
Gets the flow's acknowledgement mode.
|
int |
getAckThreshold()
Gets the flow's acknowledgement threshold.
|
int |
getAckTimerInMsecs()
Gets the flow's acknowledgement timer value (in milliseconds).
|
Endpoint |
getEndpoint()
Gets the remote Endpoint to bind to.
|
Subscription |
getNewSubscription()
If binding to a
TopicEndpoint , the subscription to set on the
Endpoint. |
int |
getReconnectRetryIntervalInMsecs()
Gets how much time (in ms) to wait between each attempt to reconnect to an endpoint.
|
int |
getReconnectTries()
Gets number of times to attempt to reconnect to an endpoint after the initial bound flow goes down.
|
ReplayStartLocation |
getReplayStartLocation()
Gets the message replay start location, or null if it is not set.
|
String |
getSelector()
Gets the message selector, if one is set.
|
int |
getTransportWindowSize()
Returns the Guaranteed message transport window size for the flow.
|
boolean |
isActiveFlowIndication()
Gets the flow's active flow indication state.
|
boolean |
isNoLocal()
Gets the flow's
noLocal setting. |
boolean |
isStartState()
Checks whether a newly created flow should be in the started state upon
creation.
|
ConsumerFlowProperties |
setAckMode(String ackMode)
Indicates whether the acknowledgement of receiving a message is done by
JCSMP automatically or by the application explicitly calling
XMLMessage.ackMessage() or XMLMessage.settle(Outcome) . |
ConsumerFlowProperties |
setAckThreshold(int ackThreshold)
Sets threshold for sending an acknowledgement, as a percentage of
window size . |
ConsumerFlowProperties |
setAckTimerInMsecs(int ackTimerInMsecs)
Sets the acknowledgement timer for the flow (in milliseconds).
|
ConsumerFlowProperties |
setActiveFlowIndication(boolean activeFlowIndication)
Applications that require a separate message for active or inactive flow indication
must set this property to
true when creating the flow. |
ConsumerFlowProperties |
setEndpoint(Endpoint endpoint)
The appliance Endpoint to bind to.
|
ConsumerFlowProperties |
setNewSubscription(Subscription newSubscription)
If binding to a
TopicEndpoint , the Topic to
set/replace as a topic subscription on the endpoint. |
ConsumerFlowProperties |
setNoLocal(boolean noLocal)
When the flow has the
noLocal flag enabled, messages published on the
session cannot appear in a flow created in the same session, even if the endpoint
contains a subscription that matches the published message. |
ConsumerFlowProperties |
setReconnectRetryIntervalInMsecs(int val)
This property specifies how much time (in ms) to wait between each attempt to reconnect to an endpoint.
|
ConsumerFlowProperties |
setReconnectTries(int count)
This property specifies the number of times to attempt to reconnect to an endpoint after the initial bound flow goes down.
|
ConsumerFlowProperties |
setReplayStartLocation(ReplayStartLocation startLocation)
This property specifies a message replay start location.
|
ConsumerFlowProperties |
setSelector(String selector)
A SQL-92 selector to use for selection of messages for delivery.
|
ConsumerFlowProperties |
setStartState(boolean startState)
Controls whether a newly created flow should be in the started state upon
creation.
|
ConsumerFlowProperties |
setTransportWindowSize(int winSz)
Sets the Guaranteed message transport window size for the flow.
|
public ConsumerFlowProperties()
ConsumerFlowProperties
.public Endpoint getEndpoint()
Endpoint
object targeted for this flow.public ConsumerFlowProperties setEndpoint(Endpoint endpoint)
endpoint
- parameterpublic Subscription getNewSubscription()
TopicEndpoint
, the subscription to set on the
Endpoint.public ConsumerFlowProperties setNewSubscription(Subscription newSubscription)
TopicEndpoint
, the Topic
to
set/replace as a topic subscription on the endpoint.
This must be specified for a TopicEndpoint, null otherwise.newSubscription
- The subscription to set.public String getSelector()
public ConsumerFlowProperties setSelector(String selector)
selector
- The selector to use on this flow.public boolean isStartState()
startState
property.public ConsumerFlowProperties setStartState(boolean startState)
false
: new message flows are
created in the stopped state.startState
- Whether a newly created flow based on these properties should
be started automatically.public ConsumerFlowProperties setAckMode(String ackMode)
XMLMessage.ackMessage()
or XMLMessage.settle(Outcome)
. Default: null
(inherit from
session).
Allowed values are:
If message acknowledgement mode for the flow is
SUPPORTED_MESSAGE_ACK_AUTO
(the default behaviour),
the call to XMLMessage.ackMessage()
is ignored and a warning log is generated.
ackMode
- The acknowledgement mode to use.public String getAckMode()
ConsumerFlowProperties.setAckMode(String)
public int getTransportWindowSize()
public ConsumerFlowProperties setTransportWindowSize(int winSz)
If the transport window size is set to N, the maximum number of messages that can be in transit (that is, the messages are sent from the appliance, but are not yet delivered to the application) is N+1.
winSz
- The Guaranteed message window size.public int getAckTimerInMsecs()
public ConsumerFlowProperties setAckTimerInMsecs(int ackTimerInMsecs)
The valid range is 20-1500.
ackTimerInMsecs
- The flow message acknowledgement timer.public int getAckThreshold()
public ConsumerFlowProperties setAckThreshold(int ackThreshold)
window size
. The valid range is
1-75. Default: 0 (inherit from session).ackThreshold
- Acknowledgement thresholdpublic boolean isNoLocal()
noLocal
setting.noLocal
setting.ConsumerFlowProperties.setNoLocal(boolean)
public ConsumerFlowProperties setNoLocal(boolean noLocal)
noLocal
flag enabled, messages published on the
session cannot appear in a flow created in the same session, even if the endpoint
contains a subscription that matches the published message.
The appliance that the session connects to must have the No Local capability, and the capability must be must be enabled.
Default: false
.
noLocal
- Whether to set the NoLocal option on this flow.this
InvalidOperationException
- If this option is requested, but the peer does not support
CapabilityType.NO_LOCAL
.public boolean isActiveFlowIndication()
public ConsumerFlowProperties setActiveFlowIndication(boolean activeFlowIndication)
true
when creating the flow.
If the underlying session capabilities indicate that the appliance does not support
active flow indication (CapabilityType.ACTIVE_FLOW_INDICATION
), then
JCSMPSession.createFlow(XMLMessageListener, ConsumerFlowProperties)
will fail immediately and throw a InvalidOperationException
.
Default: false
activeFlowIndication
- parameterpublic ConsumerFlowProperties setReplayStartLocation(ReplayStartLocation startLocation)
CapabilityType.MESSAGE_REPLAY
)
then JCSMPSession.createFlow(...) will fail immediately with
InvalidOperationException thrown.startLocation
- replay start locationpublic ReplayStartLocation getReplayStartLocation()
public int getReconnectTries()
public ConsumerFlowProperties setReconnectTries(int count)
public int getReconnectRetryIntervalInMsecs()
public ConsumerFlowProperties setReconnectRetryIntervalInMsecs(int val)
public void addRequiredSettlementOutcomes(XMLMessage.Outcome... requiredOutcomes)
XMLMessage.Outcome.FAILED
or XMLMessage.Outcome.REJECTED
.
NOTE: XMLMessage.Outcome.ACCEPTED
is always available and can always be used to indicate a successful message settlement,
regardless of whether it is specified in the list of required outcomes.
NOTE: Ignored on transacted flows
requiredOutcomes
- if set, flow bind request will respect requirements provided and prevent flow from being established with older unsupported broker.Copyright 2004-2024 Solace Corporation. All rights reserved.