Class RecoveryManagerImpl
java.lang.Object
com.sportradar.unifiedodds.sdk.internal.impl.recovery.RecoveryManagerImpl
- All Implemented Interfaces:
com.rabbitmq.client.RecoveryListener,com.rabbitmq.client.ShutdownListener,RabbitMqSystemListener,EventRecoveryRequestIssuer,RecoveryManager,EventListener
public class RecoveryManagerImpl
extends Object
implements RecoveryManager, EventRecoveryRequestIssuer, RabbitMqSystemListener
An implementation of the
RecoveryManager used to manage recovery operations-
Method Summary
Modifier and TypeMethodDescriptionvoidhandleRecovery(com.rabbitmq.client.Recoverable recoverable) This method gets invoked by the RabbitMQ library when the auto-recovery kicks-invoidhandleRecoveryStarted(com.rabbitmq.client.Recoverable recoverable) voidhandleTopologyRecoveryStarted(com.rabbitmq.client.Recoverable recoverable) initiateEventOddsMessagesRecovery(Producer producer, Urn eventId) Initiates a odds recovery procedure for the event associated with the providedUrnidentifier on the requestedProducer(The odds recovery procedure re-sends all odds for all markets for a sport event) Note: The event must be eitherEventStatus.NotStartedorEventStatus.LiveinitiateEventStatefulMessagesRecovery(Producer producer, Urn eventId) Initiates a stateful recovery procedure for the event associated with the providedUrnidentifier on the requestedProducer(The stateful message recovery procedure re-sends all stateful-messages (BetSettlement, RollbackBetSettlement, BetCancel, UndoBetCancel) for a sport event) Note: The event can be up to 30 days in the pastvoidonAliveReceived(int producerId, long aliveGenTimestamp, long receivedTimestamp, boolean subscribed, boolean isSystemSession) Method invoked when the message of type "Alive" is receivedvoidonMessageProcessingEnded(int uniqueMessageProcessorIdentifier, int producerId, Long processedMessageGenTimestamp, String eventId) Method invoked when the AMQP message processing endedvoidonMessageProcessingStarted(int uniqueMessageProcessorIdentifier, int producerId, Long requestId, long now) Method invoked when the AMQP message processing startedvoidonSnapshotCompleteReceived(int producerId, long nowTimestamp, long requestId, MessageInterest sessionMessageInterest) Method invoked when the message of type "SnapshotComplete" is receivedvoidrequestManualProducerRecovery(int id, long timestampForRecovery) voidshutdownCompleted(com.rabbitmq.client.ShutdownSignalException cause) This method is called when the AMQP channel gets shut down/disconnect detected
-
Method Details
-
onMessageProcessingStarted
public void onMessageProcessingStarted(int uniqueMessageProcessorIdentifier, int producerId, Long requestId, long now) Description copied from interface:RecoveryManagerMethod invoked when the AMQP message processing started- Specified by:
onMessageProcessingStartedin interfaceRecoveryManager- Parameters:
uniqueMessageProcessorIdentifier- a unique representation of the message processor invoking the methodproducerId- the source producer of the messagerequestId- the recovery request id of the message (if present)now- the current timestamp
-
onMessageProcessingEnded
public void onMessageProcessingEnded(int uniqueMessageProcessorIdentifier, int producerId, Long processedMessageGenTimestamp, String eventId) Description copied from interface:RecoveryManagerMethod invoked when the AMQP message processing ended- Specified by:
onMessageProcessingEndedin interfaceRecoveryManager- Parameters:
uniqueMessageProcessorIdentifier- a unique representation of the message processor invoking the methodproducerId- the source producer of the messageprocessedMessageGenTimestamp- the generated timestamp of the processed messageeventId- the eventId associated with feed message (if present)
-
onAliveReceived
public void onAliveReceived(int producerId, long aliveGenTimestamp, long receivedTimestamp, boolean subscribed, boolean isSystemSession) Description copied from interface:RecoveryManagerMethod invoked when the message of type "Alive" is received- Specified by:
onAliveReceivedin interfaceRecoveryManager- Parameters:
producerId- the producer which generated the Alive messagealiveGenTimestamp- the message generation timestampreceivedTimestamp- the timestamp of when the message was receivedsubscribed- an indication if the Alive message was sent from a producer that the SDK is subscribed toisSystemSession- an indication if the alive was received on the system session
-
onSnapshotCompleteReceived
public void onSnapshotCompleteReceived(int producerId, long nowTimestamp, long requestId, MessageInterest sessionMessageInterest) Description copied from interface:RecoveryManagerMethod invoked when the message of type "SnapshotComplete" is received- Specified by:
onSnapshotCompleteReceivedin interfaceRecoveryManager- Parameters:
producerId- the producer which generated the Alive messagenowTimestamp- the timestamp of when the message was receivedrequestId- the request id that is the cause of the SnapshotCompletesessionMessageInterest- the message interest of the session that received the message
-
initiateEventOddsMessagesRecovery
Description copied from interface:EventRecoveryRequestIssuerInitiates a odds recovery procedure for the event associated with the providedUrnidentifier on the requestedProducer(The odds recovery procedure re-sends all odds for all markets for a sport event) Note: The event must be eitherEventStatus.NotStartedorEventStatus.Live- Specified by:
initiateEventOddsMessagesRecoveryin interfaceEventRecoveryRequestIssuer- Parameters:
producer- the producer on which the recovery should be initializedeventId- theUrnidentifier of the event for which the recovery is needed- Returns:
- the identifier of the recovery request, if the request executed successfully; otherwise null
-
initiateEventStatefulMessagesRecovery
Description copied from interface:EventRecoveryRequestIssuerInitiates a stateful recovery procedure for the event associated with the providedUrnidentifier on the requestedProducer(The stateful message recovery procedure re-sends all stateful-messages (BetSettlement, RollbackBetSettlement, BetCancel, UndoBetCancel) for a sport event) Note: The event can be up to 30 days in the past- Specified by:
initiateEventStatefulMessagesRecoveryin interfaceEventRecoveryRequestIssuer- Parameters:
producer- the producer on which the recovery should be initializedeventId- theUrnidentifier of the event for which the recovery is needed- Returns:
- the identifier of the recovery request, if the request executed successfully; otherwise null
-
handleRecovery
public void handleRecovery(com.rabbitmq.client.Recoverable recoverable) This method gets invoked by the RabbitMQ library when the auto-recovery kicks-in- Specified by:
handleRecoveryin interfacecom.rabbitmq.client.RecoveryListener
-
handleRecoveryStarted
public void handleRecoveryStarted(com.rabbitmq.client.Recoverable recoverable) - Specified by:
handleRecoveryStartedin interfacecom.rabbitmq.client.RecoveryListener
-
handleTopologyRecoveryStarted
public void handleTopologyRecoveryStarted(com.rabbitmq.client.Recoverable recoverable) - Specified by:
handleTopologyRecoveryStartedin interfacecom.rabbitmq.client.RecoveryListener
-
shutdownCompleted
public void shutdownCompleted(com.rabbitmq.client.ShutdownSignalException cause) This method is called when the AMQP channel gets shut down/disconnect detected- Specified by:
shutdownCompletedin interfacecom.rabbitmq.client.ShutdownListener
-
requestManualProducerRecovery
public void requestManualProducerRecovery(int id, long timestampForRecovery)
-