Interface MamaSubscriptionCallback


  • public interface MamaSubscriptionCallback
    The message callback interface. Callers provide an object implementing this interface on creating a MamaSubscription.
    See Also:
    MamaSubscription
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void onCreate​(MamaSubscription subscription)
      Method invoked when subscription creation is complete.
      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.
      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.
      void onGap​(MamaSubscription subscription)
      Method invoked when a sequence number gap is detected.
      void onMsg​(MamaSubscription subscription, MamaMsg msg)
      Invoked when a message arrives.
      void onQuality​(MamaSubscription subscription, short quality, short cause, java.lang.Object platformInfo)
      Invoked when a the quality of this subscription changes.
      void onRecapRequest​(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 for onMsg calls to be processed to be called before the onCreate callback 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_ENTITTLED the 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_ENTITLED
        e -
      • onMsg

        void onMsg​(MamaSubscription subscription,
                   MamaMsg msg)
        Invoked when a message arrives.
        Parameters:
        subscription - the MamaSubscription.
        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 - the MamaSubscription.
        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 - the MamaSubscription.
      • 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 - the MamaSubscription.
      • 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.