Package com.wombat.mama
Interface MamaSubscriptionCallback
-
public interface MamaSubscriptionCallbackThe message callback interface. Callers provide an object implementing this interface on creating aMamaSubscription.- See Also:
MamaSubscription
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidonCreate(MamaSubscription subscription)Method invoked when subscription creation is complete.voidonDestroy(MamaSubscription subscription)This method is invoked when a subscription has been completely destroyed or deactivated, the client can have confidence that no further messages will be placed on the queue for this subscription.voidonError(MamaSubscription subscription, short wombatStatus, int platformError, java.lang.String subject, java.lang.Exception e)Invoked if an error occurs during subscription creation or if the subscription receives a message for an unentitled subject.voidonGap(MamaSubscription subscription)Method invoked when a sequence number gap is detected.voidonMsg(MamaSubscription subscription, MamaMsg msg)Invoked when a message arrives.voidonQuality(MamaSubscription subscription, short quality, short cause, java.lang.Object platformInfo)Invoked when a the quality of this subscription changes.voidonRecapRequest(MamaSubscription subscription)Method invoked when a recap is requested upon detecting a sequence number gap.
-
-
-
Method Detail
-
onCreate
void onCreate(MamaSubscription subscription)
Method invoked when subscription creation is complete. Since subscriptions are created asynchronous by throttle, this callback provides the subscription instance after the throttle processes the creation request. In the case where a subscription is created on a queue other than the default it is possible foronMsgcalls to be processed to be called before theonCreatecallback is processed.- Parameters:
subscription- The subscription.
-
onError
void onError(MamaSubscription subscription, short wombatStatus, int platformError, java.lang.String subject, java.lang.Exception e)
Invoked if an error occurs during subscription creation or if the subscription receives a message for an unentitled subject.If the status is
MamaStatus.NOT_ENTITTLEDthe subject parameter is the specific unentitled subject. If the subscription subject contains wildcards, the subscription may still receive messages for other entitled subjects.- Parameters:
subscription- The subscription.wombatStatus- The wombat error code.platformError- Third party, platform specific messaging error.subject- The subject for NOT_ENTITLEDe-
-
onMsg
void onMsg(MamaSubscription subscription, MamaMsg msg)
Invoked when a message arrives.- Parameters:
subscription- theMamaSubscription.msg- The MamaMsg.
-
onQuality
void onQuality(MamaSubscription subscription, short quality, short cause, java.lang.Object platformInfo)
Invoked when a the quality of this subscription changes.- Parameters:
subscription- theMamaSubscription.quality- The new quality: one of the values in the MamaQuality class.cause- The cause of the data quality event.platformInfo- Info associated with the data quality event. The cause and platformInfo are supplied only by some middlewares. The information provided by platformInfo is middleware specific. The following middlewares are supported: tibrv: provides the String object version of the tibrv advisory message
-
onRecapRequest
void onRecapRequest(MamaSubscription subscription)
Method invoked when a recap is requested upon detecting a sequence number gap.- Parameters:
subscription- theMamaSubscription.
-
onGap
void onGap(MamaSubscription subscription)
Method invoked when a sequence number gap is detected. At this point the topic is considered stale and the subscription will not receive further messages until the feed handler satisfies a recap request.- Parameters:
subscription- theMamaSubscription.
-
onDestroy
void onDestroy(MamaSubscription subscription)
This method is invoked when a subscription has been completely destroyed or deactivated, the client can have confidence that no further messages will be placed on the queue for this subscription.- Parameters:
subscription- The MamaSubscription.
-
-