Class ReliableMessagingFeature
- java.lang.Object
-
- javax.xml.ws.WebServiceFeature
-
- com.sun.xml.ws.rx.rm.api.ReliableMessagingFeature
-
- All Implemented Interfaces:
StickyFeature
@ManagedData public class ReliableMessagingFeature extends javax.xml.ws.WebServiceFeature implements StickyFeature
Reliable messaging feature is an implementation ofWebServiceFeature
that configures Metro Reliable Messaging runtime functionality. Since there is a lot to configure in Reliable Messaging domain, to build create an instance ofReliableMessagingFeature
, use a convenienceReliableMessagingFeatureBuilder
builder class.- Author:
- Marek Potociar
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ReliableMessagingFeature.BackoffAlgorithm
Defines the enumeration of all possible backoff algortihms that can be applied for to message retransmission.static class
ReliableMessagingFeature.DeliveryAssurance
Defines the enumeration of Delivery Assurance options, which can be supported by RM Sources and RM Destinations.static class
ReliableMessagingFeature.SecurityBinding
Defines the enumeration of possible security binding mechanism options that can be applied to a created sequence.
-
Field Summary
Fields Modifier and Type Field Description static long
DEFAULT_ACK_REQUEST_TRANSMISSION_INTERVAL
A constant specifying the default value of interval between sending subsequent acknowledgement request messages.static long
DEFAULT_ACKNOWLEDGEMENT_TRANSMISSION_INTERVAL
Specifies the duration in milliseconds after which the RM Destination will transmit an acknowledgement.static long
DEFAULT_CLOSE_SEQUENCE_OPERATION_TIMEOUT
A constant specifying the default value of close sequence operation timeout.static long
DEFAULT_DESTINATION_BUFFER_QUOTA
A constant specifying the default value of destination flow control buffer quota.static long
DEFAULT_MAX_CONCURRENT_SESSIONS
A constant specifying the default value for how many concurrently active RM sessions (measured based on inbound RM sequences) the sequence manager dedicated to the WS Endpoint accepts before starting to refuse new requests for sequence creation.static long
DEFAULT_MAX_MESSAGE_RETRANSMISSION_COUNT
A constant specifies the default value of maximum number of message redelivery attempts.static long
DEFAULT_MAX_RM_SESSION_CONTROL_MESSAGE_RESEND_ATTEMPTS
A constant specifies the default value of maximum number of attempts to send a reliable messaging session control messgae such as CreateSequence, CloseSequence and TerminateSequence Currently, the default value is set to 3.static long
DEFAULT_MESSAGE_RETRANSMISSION_INTERVAL
A constant specifying the default value of base message retransmission interval.static boolean
DEFAULT_OFFER_ELEMENT_GENERATION_DISABLED
A constant specifying the default value for disabling the generation of theOffer
element as part of theCreateSequence
message.static boolean
DEFAULT_REJECT_OUT_OF_ORDER_MESSAGES
A constant specifying the default value for enabling "reject out-of-order messages".static long
DEFAULT_SEQUENCE_INACTIVITY_TIMEOUT
A constant specifying the default value of sequence inactivity timeout.static long
DEFAULT_SEQUENCE_MANAGER_MAINTENANCE_PERIOD
Default period (in milliseconds) of a sequence manager maintenance task execution.static boolean
DEFAULT_STATE_UPDATE_ON_RECEIVED_ACKREQUESTED_DISABLED
A constant specifying the default value for turning off state update when received AckRequested is processed at RMD.static boolean
DEFAULT_XA_TX_FOR_SERVER_RMD
A constant specifying the default value for enabling XA TX at server side RMD.static int
DEFAULT_XA_TX_FOR_SERVER_RMD_TIMEOUT_SECONDS
A constant specifying the default value for XA TX timeout that is used at server side RMD (in seconds).static String
ID
-
Constructor Summary
Constructors Constructor Description ReliableMessagingFeature()
This constructor is here to satisfy JAX-WS specification requirementsReliableMessagingFeature(boolean enabled)
This constructor is here to satisfy JAX-WS specification requirementsReliableMessagingFeature(boolean enabled, RmProtocolVersion version, long inactivityTimeout, long bufferQuota, boolean orderedDelivery, ReliableMessagingFeature.DeliveryAssurance deliveryAssurance, ReliableMessagingFeature.SecurityBinding securityBinding, boolean persistenceEnabled, long sequenceManagerMaintenancePeriod, long maxConcurrentSessions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canRetransmitMessage(long nextRetransmissionCount)
Returnstrue
if the next attempt to retransmit a message indicated bynextRetransmissionCount
input parameter is allowed as per current feature configuration.long
getAcknowledgementTransmissionInterval()
Specifies the duration after which the RM Destination will transmit an acknowledgement.long
getAckRequestTransmissionInterval()
Specifies interval between sending subsequent acknowledgement request messages by an RM Source in case of any unacknowledged messages on the sequence.long
getCloseSequenceOperationTimeout()
Specifies the timeout for aCloseSequenceRequest
message.ReliableMessagingFeature.DeliveryAssurance
getDeliveryAssurance()
Specifies the message delivery quality of service between the RM and application layer.long
getDestinationBufferQuota()
This attribute may be used together with ordered delivery requirement.String
getID()
long
getMaxConcurrentSessions()
Specifies how many concurrently active RM sessions (measured based on inbound RM sequences) the sequence manager dedicated to the WS Endpoint accepts before starting to refuse new requests for sequence creation.long
getMaxMessageRetransmissionCount()
A message is considered to be transferred if its delivery at the recipient has been acknowledged by the recipient.long
getMaxRmSessionControlMessageResendAttempts()
The infrastructure tries to send each RM session protocol control message such as CreateSequence, CloseSequence, TerminateSequence at most agetMaxRmSessionControlMessageResendAttempts()
number of times.long
getMessageRetransmissionInterval()
Specifies how long the RM Source will wait after transmitting a message before retransmitting the message if no acknowledgement arrives.RmProtocolVersion
getProtocolVersion()
Specifies which WS-RM version SOAP messages and SOAP message headers should be used for communication between RM source and RM destinationReliableMessagingFeature.BackoffAlgorithm
getRetransmissionBackoffAlgorithm()
Specifies that the retransmission interval will be adjusted using a specific backoff algorithm.ReliableMessagingFeature.SecurityBinding
getSecurityBinding()
Specifies whether each created RM sequence must be bound to a specific underlying security token or secured transport.long
getSequenceInactivityTimeout()
Specifies a period of inactivity for a Sequence in ms.long
getSequenceManagerMaintenancePeriod()
Specifies the period (in milliseconds) of a sequence manager maintenance task execution.boolean
isOfferElementGenerationDisabled()
Specifies whether the generation of theOffer
element as part of theCreateSequence
message is forced-disabled or not.boolean
isOrderedDeliveryEnabled()
Specifies a requirement that messages from each individual Sequence are to be delivered in the same order they have been sent by the Application Source.boolean
isPersistenceEnabled()
Specifies whether the runtime should use persistent message storage or not.boolean
isRejectOutOfOrderMessagesEnabled()
Specifies whether RMD should reject out-of-order messages that it receives.String
toString()
-
-
-
Field Detail
-
ID
public static final String ID
- See Also:
- Constant Field Values
-
DEFAULT_SEQUENCE_INACTIVITY_TIMEOUT
public static final long DEFAULT_SEQUENCE_INACTIVITY_TIMEOUT
A constant specifying the default value of sequence inactivity timeout. Currently the default value is set to 600000.- See Also:
- Constant Field Values
-
DEFAULT_DESTINATION_BUFFER_QUOTA
public static final long DEFAULT_DESTINATION_BUFFER_QUOTA
A constant specifying the default value of destination flow control buffer quota. Currently the default value is set to 32.- See Also:
- Constant Field Values
-
DEFAULT_MESSAGE_RETRANSMISSION_INTERVAL
public static final long DEFAULT_MESSAGE_RETRANSMISSION_INTERVAL
A constant specifying the default value of base message retransmission interval. Currently the default value is set to 2000.- See Also:
- Constant Field Values
-
DEFAULT_MAX_MESSAGE_RETRANSMISSION_COUNT
public static final long DEFAULT_MAX_MESSAGE_RETRANSMISSION_COUNT
A constant specifies the default value of maximum number of message redelivery attempts. Currently, the default value is set to infinity (-1).- See Also:
- Constant Field Values
-
DEFAULT_MAX_RM_SESSION_CONTROL_MESSAGE_RESEND_ATTEMPTS
public static final long DEFAULT_MAX_RM_SESSION_CONTROL_MESSAGE_RESEND_ATTEMPTS
A constant specifies the default value of maximum number of attempts to send a reliable messaging session control messgae such as CreateSequence, CloseSequence and TerminateSequence Currently, the default value is set to 3.- See Also:
- Constant Field Values
-
DEFAULT_ACKNOWLEDGEMENT_TRANSMISSION_INTERVAL
public static final long DEFAULT_ACKNOWLEDGEMENT_TRANSMISSION_INTERVAL
Specifies the duration in milliseconds after which the RM Destination will transmit an acknowledgement. Currently the default value is set to -1 => unspecified.- See Also:
- Constant Field Values
-
DEFAULT_ACK_REQUEST_TRANSMISSION_INTERVAL
public static final long DEFAULT_ACK_REQUEST_TRANSMISSION_INTERVAL
A constant specifying the default value of interval between sending subsequent acknowledgement request messages. Currently the default value is set to 2000.- See Also:
- Constant Field Values
-
DEFAULT_CLOSE_SEQUENCE_OPERATION_TIMEOUT
public static final long DEFAULT_CLOSE_SEQUENCE_OPERATION_TIMEOUT
A constant specifying the default value of close sequence operation timeout. Currently the default value is set to 3000.- See Also:
- Constant Field Values
-
DEFAULT_SEQUENCE_MANAGER_MAINTENANCE_PERIOD
public static final long DEFAULT_SEQUENCE_MANAGER_MAINTENANCE_PERIOD
Default period (in milliseconds) of a sequence manager maintenance task execution.- See Also:
- Constant Field Values
-
DEFAULT_MAX_CONCURRENT_SESSIONS
public static final long DEFAULT_MAX_CONCURRENT_SESSIONS
A constant specifying the default value for how many concurrently active RM sessions (measured based on inbound RM sequences) the sequence manager dedicated to the WS Endpoint accepts before starting to refuse new requests for sequence creation. Currently, the default value is set to infinity (-1).- See Also:
- Constant Field Values
-
DEFAULT_OFFER_ELEMENT_GENERATION_DISABLED
public static final boolean DEFAULT_OFFER_ELEMENT_GENERATION_DISABLED
A constant specifying the default value for disabling the generation of theOffer
element as part of theCreateSequence
message.- See Also:
- Constant Field Values
-
DEFAULT_REJECT_OUT_OF_ORDER_MESSAGES
public static final boolean DEFAULT_REJECT_OUT_OF_ORDER_MESSAGES
A constant specifying the default value for enabling "reject out-of-order messages".- See Also:
- Constant Field Values
-
DEFAULT_STATE_UPDATE_ON_RECEIVED_ACKREQUESTED_DISABLED
public static final boolean DEFAULT_STATE_UPDATE_ON_RECEIVED_ACKREQUESTED_DISABLED
A constant specifying the default value for turning off state update when received AckRequested is processed at RMD.- See Also:
- Constant Field Values
-
DEFAULT_XA_TX_FOR_SERVER_RMD
public static final boolean DEFAULT_XA_TX_FOR_SERVER_RMD
A constant specifying the default value for enabling XA TX at server side RMD.- See Also:
- Constant Field Values
-
DEFAULT_XA_TX_FOR_SERVER_RMD_TIMEOUT_SECONDS
public static final int DEFAULT_XA_TX_FOR_SERVER_RMD_TIMEOUT_SECONDS
A constant specifying the default value for XA TX timeout that is used at server side RMD (in seconds).- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ReliableMessagingFeature
public ReliableMessagingFeature()
This constructor is here to satisfy JAX-WS specification requirements
-
ReliableMessagingFeature
public ReliableMessagingFeature(boolean enabled)
This constructor is here to satisfy JAX-WS specification requirements
-
ReliableMessagingFeature
public ReliableMessagingFeature(boolean enabled, RmProtocolVersion version, long inactivityTimeout, long bufferQuota, boolean orderedDelivery, ReliableMessagingFeature.DeliveryAssurance deliveryAssurance, ReliableMessagingFeature.SecurityBinding securityBinding, boolean persistenceEnabled, long sequenceManagerMaintenancePeriod, long maxConcurrentSessions)
-
-
Method Detail
-
getID
@ManagedAttribute public String getID()
- Specified by:
getID
in classjavax.xml.ws.WebServiceFeature
-
getProtocolVersion
@ManagedAttribute public RmProtocolVersion getProtocolVersion()
Specifies which WS-RM version SOAP messages and SOAP message headers should be used for communication between RM source and RM destination- Returns:
- version currently configured for the feature. If not set explicitly,
the default value is specified by a call to
RmVersion#getDefault()
.
-
getSequenceInactivityTimeout
@ManagedAttribute public long getSequenceInactivityTimeout()
Specifies a period of inactivity for a Sequence in ms.- Returns:
- currently configured sequence inactivity timeout. If not set explicitly,
the default value is specified by
DEFAULT_SEQUENCE_INACTIVITY_TIMEOUT
constant.
-
getSecurityBinding
@ManagedAttribute public ReliableMessagingFeature.SecurityBinding getSecurityBinding()
Specifies whether each created RM sequence must be bound to a specific underlying security token or secured transport.- Returns:
- configured security binding requirement. If not set explicitly, the
default value is specified by a call to
ReliableMessagingFeature.SecurityBinding.getDefault()
. - See Also:
ReliableMessagingFeature.SecurityBinding
-
getDeliveryAssurance
@ManagedAttribute public ReliableMessagingFeature.DeliveryAssurance getDeliveryAssurance()
Specifies the message delivery quality of service between the RM and application layer. It expresses the delivery assurance in effect between the RM Destination and its corresponding application destination, and it also indicates requirements on any RM Source that transmits messages to this RM destination. Conversely when used by an RM Source it expresses the delivery assurance in effect between the RM Source and its corresponding application source, as well as indicating requirements on any RM Destination that receives messages from this RM Source. In either case the delivery assurance does not affect the messages transmitted on the wire.- Returns:
- currently configured delivery assurance mode. If not set explicitly,
the default value is specified by a call to
ReliableMessagingFeature.DeliveryAssurance.getDefault()
. - See Also:
ReliableMessagingFeature.DeliveryAssurance
-
isOrderedDeliveryEnabled
@ManagedAttribute public boolean isOrderedDeliveryEnabled()
Specifies a requirement that messages from each individual Sequence are to be delivered in the same order they have been sent by the Application Source. The RM Source will ensure that the ordinal position of each message in the Sequence (as indicated by a message Sequence number) is consistent with the order in which the messages have been sent from the Application Source. The RM Destination will deliver received messages for each Sequence in the order indicated by the message numbering.
In-order delivery can be used in combination with any of the
ReliableMessagingFeature.DeliveryAssurance
values, and the requirements of those values will also be met. In particular if theReliableMessagingFeature.DeliveryAssurance.AT_LEAST_ONCE
orReliableMessagingFeature.DeliveryAssurance.EXACTLY_ONCE
value is applied and the RM Destination detects a gap in the Sequence then the RM Destination will not deliver any subsequent messages from that Sequence until the missing messages are received or until the Sequence is closed.- Returns:
true
if the ordered delivery si required,false
otherwise. If not set explicitly, the default value isfalse
.
-
getDestinationBufferQuota
@ManagedAttribute public long getDestinationBufferQuota()
This attribute may be used together with ordered delivery requirement. It specifies the maximum number of out-of-order unprocessed request messages that may be stored in the unprocessed request message buffer within the RM destination before the RM destination starts rejecting new request messages.- Returns:
- currently configured flow control buffer on the destination. If not
set explicitly, the default value is specified by
DEFAULT_DESTINATION_BUFFER_QUOTA
constant.
-
getMessageRetransmissionInterval
@ManagedAttribute public long getMessageRetransmissionInterval()
Specifies how long the RM Source will wait after transmitting a message before retransmitting the message if no acknowledgement arrives.- Returns:
- currently configured base retransmission interval. If not set explicitly,
the default value is specified by
DEFAULT_MESSAGE_RETRANSMISSION_INTERVAL
constant.
-
getRetransmissionBackoffAlgorithm
@ManagedAttribute public ReliableMessagingFeature.BackoffAlgorithm getRetransmissionBackoffAlgorithm()
Specifies that the retransmission interval will be adjusted using a specific backoff algorithm.- Returns:
- currently configured retransmission back-off algorithm that should be
used. If not set explicitly, the default value is specified by a
call to
ReliableMessagingFeature.BackoffAlgorithm.getDefault()
. - See Also:
ReliableMessagingFeature.BackoffAlgorithm
-
getMaxMessageRetransmissionCount
@ManagedAttribute public long getMaxMessageRetransmissionCount()
A message is considered to be transferred if its delivery at the recipient has been acknowledged by the recipient. If an acknowledgment has not been received within a certain amount of time for a message that has been transmitted, the infrastructure automatically retransmits the message. By default, the number of retransmissions is not limited. This can be checked by a call to#isMessageRetransmissionLimited()
method. In case the#isMessageRetransmissionLimited()
returnstrue
, the infrastructure tries to send the message for at most agetMaxMessageRetransmissionCount()
number of times. Not receiving an acknowledgment before this limit is reached is considered to be a fatal communication failure, and causes the RM session to fail. The infrastructure uses a back-off algorithm retrieved viagetRetransmissionBackoffAlgorithm()
to determine when to retransmit, based on the configured base retransmission time retrieved via a call togetMessageRetransmissionInterval()
.- Returns:
- maximum number of message transmission retries
-
canRetransmitMessage
public boolean canRetransmitMessage(long nextRetransmissionCount)
Returnstrue
if the next attempt to retransmit a message indicated bynextRetransmissionCount
input parameter is allowed as per current feature configuration.- Parameters:
nextRetransmissionCount
- indicates the ordinal number of the next (potential) attempt to retransmit a single message- Returns:
true
if it is possible to retransmit a message,false
otherwise.- See Also:
getMaxMessageRetransmissionCount()
-
getMaxRmSessionControlMessageResendAttempts
@ManagedAttribute public long getMaxRmSessionControlMessageResendAttempts()
The infrastructure tries to send each RM session protocol control message such as CreateSequence, CloseSequence, TerminateSequence at most agetMaxRmSessionControlMessageResendAttempts()
number of times. Not receiving an acknowledgment before this limit is reached is considered a fatal communication failure, and causes the RM session to fail.- Returns:
- maximum number of reliable messaging session handshake message transmission attempts
-
getAcknowledgementTransmissionInterval
@ManagedAttribute public long getAcknowledgementTransmissionInterval()
Specifies the duration after which the RM Destination will transmit an acknowledgement. Specified in milliseconds.- Returns:
- currently configured acknowledgement transmission interval. If not set explicitly,
the default value is specified by the
DEFAULT_ACKNOWLEDGEMENT_TRANSMISSION_INTERVAL
constant.
-
getAckRequestTransmissionInterval
@ManagedAttribute public long getAckRequestTransmissionInterval()
Specifies interval between sending subsequent acknowledgement request messages by an RM Source in case of any unacknowledged messages on the sequence.- Returns:
- currently configured acknowledgement request transmission interval.
If not set explicitly, the default value is specified by the
DEFAULT_ACK_REQUEST_TRANSMISSION_INTERVAL
constant.
-
getCloseSequenceOperationTimeout
@ManagedAttribute public long getCloseSequenceOperationTimeout()
Specifies the timeout for aCloseSequenceRequest
message. If no response is returned from RM destination before the timout expires, the sequence is automatically closed by the RM source and all associated resources are released.- Returns:
- currently configured close sequence operation timeout. If not set explicitly,
the default value is specified by the
DEFAULT_CLOSE_SEQUENCE_OPERATION_TIMEOUT
constant.
-
isPersistenceEnabled
@ManagedAttribute public boolean isPersistenceEnabled()
Specifies whether the runtime should use persistent message storage or not.- Returns:
true
if the runtime should use persistent message storage,false
otherwise
-
getSequenceManagerMaintenancePeriod
@ManagedAttribute public long getSequenceManagerMaintenancePeriod()
Specifies the period (in milliseconds) of a sequence manager maintenance task execution.- Returns:
- the period (in milliseconds) of a sequence manager maintenance task execution.
-
getMaxConcurrentSessions
@ManagedAttribute public long getMaxConcurrentSessions()
Specifies how many concurrently active RM sessions (measured based on inbound RM sequences) the sequence manager dedicated to the WS Endpoint accepts before starting to refuse new requests for sequence creation.- Returns:
- maximum number of concurrent RM sessions
-
isOfferElementGenerationDisabled
public boolean isOfferElementGenerationDisabled()
Specifies whether the generation of theOffer
element as part of theCreateSequence
message is forced-disabled or not.- Returns:
true
if the generation of theOffer
element as part of theCreateSequence
message is forced-disabled,false
otherwise.
-
isRejectOutOfOrderMessagesEnabled
public boolean isRejectOutOfOrderMessagesEnabled()
Specifies whether RMD should reject out-of-order messages that it receives.- Returns:
true
if RMD should reject out-of-order messages. Default is false.
-
-