Contents
class solace.MessageConsumerProperties
Defines the properties for a solace.MessageConsumer.
Constructor Top
MessageConsumerProperties ( ) |
Properties Top
solace.MessageConsumerAcknowledgeMode |
acknowledgeMode
= solace.MessageConsumerAcknowledgeMode.AUTO
| ||
Number |
acknowledgeThreshold
= 60
| ||
Number |
acknowledgeTimeoutInMsecs
= 1000
| ||
Boolean |
activeIndicationEnabled
= false
| ||
Number |
connectAttempts
= 3
| ||
Number |
connectTimeoutInMsecs
= 10000
| ||
Boolean |
createIfMissing
= false
| ||
Boolean |
noLocal
= false
| ||
solace.QueueDescriptor | queueDescriptor | ||
solace.QueueProperties | null | undefined |
queueProperties
= undefined
| ||
Number |
reconnectAttempts
= -1
| ||
Number |
reconnectIntervalInMsecs
= 3000
| ||
solace.ReplayStartLocation |
replayStartLocation
= undefined.
| ||
[ 'Array' ].<solace.MessageOutcome> |
requiredSettlementOutcomes
= []
| ||
solace.Destination |
topicEndpointSubscription
= undefined
| ||
Number |
transportAcknowledgeThresholdPercentage
= 60
| ||
Number |
transportAcknowledgeTimeoutInMsecs
= 1000
| ||
Number |
windowSize
= 255
|
Constructor details
Top
MessageConsumerProperties
( )
Defines the properties for a solace.MessageConsumer.
Defines the properties for a solace.MessageConsumer.
Properties Detail Top
public
solace.MessageConsumerAcknowledgeMode
acknowledgeMode
= solace.MessageConsumerAcknowledgeMode.AUTO
solace.MessageConsumerAcknowledgeMode.AUTO
The Application Acknowledgement mode for the Message Consumer.
When the acknowledgement mode is solace.MessageConsumerAcknowledgeMode.CLIENT, a message is Application Acknowledged when the application calls solace.Message#acknowledge on that message.
When the acknowledge mode is solace.MessageConsumerAcknowledgeMode.AUTO, a message is Application Acknowledged by the API after all solace.MessageConsumerEventName#event:MESSAGE listeners are called and none throw an exception. If a message handler throws, the message can still be acknowledged by calling solace.Message#acknowledge, but this would not be a recommended practice.
When received messages are Application Acknowledged they are removed from the Guaranteed Message storage on the Solace Message Router. Message Consumer Application Acknowledged, only remove messages from the Solace Message Router.
In particular, withholding Message Consumer Acknowledgemnts does not stop message delivery. For Message Consumer flow control (aka transport acknowledgemeent) see solace.MessageConsumer#stop/solace.MessageConsumer#start. Message Consumer flow control may also be imlpemented by removing the solace.MessageConsumerEventName#event:MESSAGE listener.
Flow control and transport acknowledgements characteristics are defined by solace.MessageConsumerProperties#transportAcknowledgeThresholdPercentage and solace.MessageConsumerProperties#transportAcknowledgeTimeoutInMsecs
public
Number
acknowledgeThreshold
= 60
60
The threshold for sending an acknowledgement, as a percentage. The API sends a transport acknowledgment every N messages where N is calculated as this percentage of the transport window size if the endpoint's max-delivered-unacked-msgs-per-flow setting at bind time is greater than or equal to the transport window size. Otherwise, N is calculated as this percentage of the endpoint's max-delivered-unacked-msgs-per-flow setting at bind time.
- The valid range is 1 <= transportAcknowledgeThresholdPercentage <= 75.
Deprecated: Yes
public
Number
acknowledgeTimeoutInMsecs
= 1000
1000
The transport acknowledgement timeout for guaranteed messaging. When the solace.MessageConsumerProperties#transportAcknowledgeTimeoutInMsecs is not exceeded, acknowledgements will be returned to the router at intervals not less than this value.
- The valid range is 20 <= transportAcknowledgeTimeoutInMsecs <= 1500.
Deprecated: Yes
public
Boolean
activeIndicationEnabled
= false
false
When enabled, a Guaranteed Messaging Consumer requests Active and Inactive events from the router and emits them to interested listeners.
public
Number
connectAttempts
= 3
3
Gets and sets the maximum number of bind attempts when creating a connection to the Solace Message Router.
- The valid range is >= 1.
public
Number
connectTimeoutInMsecs
= 10000
10000
The bind timeout in milliseconds when creating a connection to the Solace Message Router.
- The valid range is >= 50.
public
Boolean
createIfMissing
= false
false
If the endpoint is durable, it won't be auto-created unless this flag is set. This flag has no effect for temporary endpoints, those are always created if missing. This flag has no effect for existing endpoints.
Off by default for backwards compatibility.
public
Boolean
noLocal
= false
false
When enabled, a Guaranteed Messaging Consumer does not receive messages published in the same Session, even if the endpoint contains a subscription that matches the published message.
Defines the queue from which to consume.
- For durable queues and durable topic endpoints, this must be a solace.QueueDescriptor unless solace.MessageConsumerProperties#createIfMissing is set.
- When an solace.AbstractQueueDescriptor is used, the name is generated when the solace.MessageConsumer is connected. The generated descriptor can be queried from the consumer after it has successfully connected by calling solace.MessageConsumer#getProperties.
Gets the properties of the remote queue.
- For temporary queues and temporary topic endpoints, or if solace.MessageConsumerProperties#createIfMissing is true, these properties define the endpoint that is created.
- For durable queues, these must be unset on consumer creation unless solace.MessageConsumerProperties#createIfMissing is set. The values will be populated after the queue is connected and can be retrieved by calling solace.MessageConsumer#getProperties.
public
Number
reconnectAttempts
= -1
-1
When a connected flow receives an unsolicited unbind event with subcode REPLAY_STARTED or GM_UNAVAILABLE, the SDK can reconnect the flow automatically. This property controls the flow auto reconnect feature: 0: Disable flow auto reconnect for this consumer flow. -1: Enable flow auto reconnect for this consumer flow, infiinite retries (default)
<n, positive number>: Enable flow auto reconnect for this consumer flow, n retries.
When the flow auto rebind is enabled, DOWN_ERRORs with REPLAY_STARTED and GM_UNAVAILABLE are handled internally, and not (immediately) emitted to the application. A RECONNECTING event (with the same subcode) is emitted instead, ideally followed by a RECONNECTED event when the reconnect succeedes. In case of REPLAY_STARTED, the window of message IDs and acknowledgements are reset to allow replay packets to be passed to the application without marking them as duplicates. In case of GM_UNAVAILABLE, flow state is preserved.
If reconnecting fails after exhausting the number of retries, a DOWN_ERROR is emitted with the details of the last retry.
public
Number
reconnectIntervalInMsecs
= 3000
3000
Time to wait between flow auto reconnect attempts, in milliseconds. See solace.MessageConsumerProperties.reconnectAttempts Defaults to 3 seconds (3000)
- The valid range is >= 50.
When a Flow is created, the application may request replay of messages from the replay log, even messages that have been previously delivered and removed the from topic endpoint or queue. The default is undefined, and indicates that no replay is requested.
When defined the replay start location must be a solace.ReplayStartLocation object as returned by solace.SolClientFactory.createReplayStartLocationBeginning or solace.SolClientFactory.createReplayStartLocationDate.
The solace.ReplayStartLocation returned by solace.SolClientFactory.createReplayStartLocationBeginning indicate that all messages available should be replayed.
The replay start location returned by solace.SolClientFactory.createReplayStartLocationDate indicates that all messages logged since a given date must be retrieved.
public
[ 'Array' ].<solace.MessageOutcome>
requiredSettlementOutcomes
= []
[]
The required settlement outcomes for the Message Consumer.
A session is created with SUPPORTED_MESSAGE_ACK_CLIENT by setting the requiredSettlementOutcomes property to support negative acknowledgment outcomes.
The solace.MessageOutcome.ACCEPTED outcome is not required to be set and is always supported as a settlement outcome.
When the requiredSettlementOutcomes include either solace.MessageOutcome.FAILED or solace.MessageOutcome.REJECTED, a message can be settled with any of these outcomes.
The solace.Message#acknowledge method internally calls the solace.Message#settle with the solace.MessageOutcome.ACCEPTED passed as the settlement outcome for that message.
When received messages are Application Acknowledged/Settled with a solace.MessageOutcome.ACCEPTED outcome, they are removed from the Guaranteed Message storage on the Solace Message Router.
In particular, withholding Message Consumer Acknowledgemnts does not stop message delivery. For Message Consumer flow control (aka transport acknowledgemeent) see solace.MessageConsumer#stop/solace.MessageConsumer#start. Message Consumer flow control may also be imlpemented by removing the solace.MessageConsumerEventName#event:MESSAGE listener.
Flow control and transport acknowledgements characteristics are defined by solace.MessageConsumerProperties#transportAcknowledgeThresholdPercentage and solace.MessageConsumerProperties#transportAcknowledgeTimeoutInMsecs
This must be undefined if the type of the solace.MessageConsumerProperties#queueDescriptor is not solace.QueueType.TOPIC_ENDPOINT.
If solace.MessageConsumerProperties#queueDescriptor is not durable, or solace.MessageConsumerProperties#createIfMissing is true, this may be left undefined to generate the topic endpoint's destination. When generated, the destination can be obtained from the solace.MessageConsumer after it is connected by calling solace.MessageConsumer#getDestination.
public
Number
transportAcknowledgeThresholdPercentage
= 60
60
The threshold for sending an acknowledgement, as a percentage. The API sends a transport acknowledgment every N messages where N is calculated as this percentage of the transport window size if the endpoint's max-delivered-unacked-msgs-per-flow setting at bind time is greater than or equal to the transport window size. Otherwise, N is calculated as this percentage of the endpoint's max-delivered-unacked-msgs-per-flow setting at bind time.
- The valid range is 1 <= transportAcknowledgeThresholdPercentage <= 75.
public
Number
transportAcknowledgeTimeoutInMsecs
= 1000
1000
The transport acknowledgement timeout for guaranteed messaging. When the solace.MessageConsumerProperties.transportAcknowledgeTimeoutInMsecs is not exceeded, acknowledgements will be returned to the router at intervals not less than this value.
- The valid range is 20 <= transportAcknowledgeTimeoutInMsecs <= 1500.
public
Number
windowSize
= 255
255
The window size for Guaranteed Message delivery. This is the maximum number of messages that will be prefetched from the Solace Messaging Router and queued internally by the API while waiting for the application to accept delivery of the messages.
- The valid range is 1 <= windowSize <= 255.