Class SamplingThrottleMediator

  • All Implemented Interfaces:
    AspectConfigurable, ManagedLifecycle, Mediator, SynapseArtifact

    public class SamplingThrottleMediator
    extends AbstractMediator
    implements ManagedLifecycle
    This implements the well known Sample EIP (Enterprise Integration Pattern), which controls the flow of messages and limit the rate at which the messages are flowing through the sampler

    Please note that the usage of this will require the sampler to be on the out-flow as well to correctly determine & to manage the rate.

    See Also:
    AbstractMediator
    • Constructor Detail

      • SamplingThrottleMediator

        public SamplingThrottleMediator()
    • Method Detail

      • init

        public void init​(SynapseEnvironment synapseEnvironment)
        Description copied from interface: ManagedLifecycle
        This method should implement the initialization of the implemented parts of the configuration.
        Specified by:
        init in interface ManagedLifecycle
        Parameters:
        synapseEnvironment - SynapseEnvironment to be used for initialization
      • destroy

        public void destroy()
        Description copied from interface: ManagedLifecycle
        This method should implement the destroying of the implemented parts of the configuration.
        Specified by:
        destroy in interface ManagedLifecycle
      • mediate

        public boolean mediate​(MessageContext messageContext)
        Description copied from interface: Mediator
        Invokes the mediator passing the current message for mediation. Each mediator performs its mediation action, and returns true if mediation should continue, or false if further mediation should be aborted.
        Specified by:
        mediate in interface Mediator
        Parameters:
        messageContext - the current message for mediation
        Returns:
        true if further mediation should continue
      • getSamplingRate

        public int getSamplingRate()
      • setSamplingRate

        public void setSamplingRate​(int samplingRate)
      • getId

        public String getId()
      • setId

        public void setId​(String id)
      • getTarget

        public Target getTarget()
      • setTarget

        public void setTarget​(Target target)
      • getUnitTime

        public long getUnitTime()
      • setUnitTime

        public void setUnitTime​(long unitTime)
      • setMessageQueue

        public void setMessageQueue​(MessageQueue messageQueue)
      • isMessageQueueExplicitlySet

        public boolean isMessageQueueExplicitlySet()