Interface ServerConsumer

All Superinterfaces:
Consumer, ConsumerInfo, PriorityAware
All Known Implementing Classes:
ServerConsumerImpl

public interface ServerConsumer extends Consumer, ConsumerInfo
  • Method Details

    • setlowConsumerDetection

      void setlowConsumerDetection(SlowConsumerDetectionListener listener)
    • getSlowConsumerDetecion

      SlowConsumerDetectionListener getSlowConsumerDetecion()
    • fireSlowConsumer

      void fireSlowConsumer()
    • allowReferenceCallback

      boolean allowReferenceCallback()
      The current queue settings will allow use of the Reference Execution and callback.
    • getProtocolData

      Object getProtocolData()
      this is to be used with anything specific on a protocol head.
    • setProtocolData

      void setProtocolData(Object protocolData)
      this is to be used with anything specific on a protocol head.
    • setProtocolContext

      void setProtocolContext(Object protocolContext)
    • getProtocolContext

      Object getProtocolContext()
      An object set by the Protocol implementation. it could be anything pre-determined by the implementation
    • getID

      long getID()
    • getConnectionID

      Object getConnectionID()
    • close

      void close(boolean failed) throws Exception
      Throws:
      Exception
    • removeItself

      void removeItself() throws Exception
      This method is just to remove itself from Queues. If for any reason during a close an exception occurred, the exception treatment will call removeItself what should take the consumer out of any queues.
      Throws:
      Exception
    • cancelRefs

      List<MessageReference> cancelRefs(boolean failed, boolean lastConsumedAsDelivered, Transaction tx) throws Exception
      Throws:
      Exception
    • setStarted

      void setStarted(boolean started)
    • receiveCredits

      void receiveCredits(int credits)
    • getQueue

      Queue getQueue()
    • removeReferenceByID

      MessageReference removeReferenceByID(long messageID) throws Exception
      Throws:
      Exception
    • backToDelivering

      void backToDelivering(MessageReference reference)
      Some protocols may choose to send the message back to delivering instead of redeliver. For example openwire will redeliver through the client, so messages will go back to delivering list after rollback.
    • scanDeliveringReferences

      List<MessageReference> scanDeliveringReferences(boolean remove, Function<MessageReference,Boolean> startFunction, Function<MessageReference,Boolean> endFunction)
    • acknowledge

      List<Long> acknowledge(Transaction tx, long messageID) throws Exception
      Throws:
      Exception
    • individualAcknowledge

      void individualAcknowledge(Transaction tx, long messageID) throws Exception
      Throws:
      Exception
    • reject

      void reject(long messageID) throws Exception
      Throws:
      Exception
    • individualCancel

      void individualCancel(long messageID, boolean failed) throws Exception
      Throws:
      Exception
    • forceDelivery

      void forceDelivery(long sequence)
    • setTransferring

      void setTransferring(boolean transferring)
    • isBrowseOnly

      boolean isBrowseOnly()
    • getCreationTime

      long getCreationTime()
    • getSessionID

      String getSessionID()
    • metricsAcknowledge

      void metricsAcknowledge(MessageReference ref, Transaction transaction)
      This is needed when some protocols (OW) handle the acks themselves and need to update the metrics
      Parameters:
      ref - the message reference
      transaction - the tx
    • addAttachment

      void addAttachment(String key, Object attachment)
      Adds the given attachment to the ServerConsumer which will overwrite any previously assigned value with the same key.
      Parameters:
      key - The key used to identify the attachment.
      attachment - The actual value to store for the assigned key.
    • removeAttachment

      void removeAttachment(String key)
      Remove the any attachment entry from the ServerConsumer clearing any previously assigned value
      Parameters:
      key - The key used to identify the attachment.
    • getAttachment

      Object getAttachment(String key)
      Gets any attachment that has been assigned to this ServerConsumer using the provided key. If no value was assigned a null is returned.
      Parameters:
      key - The key identifying the target attachment.
      Returns:
      the assigned value associated with the given key or null if nothing assigned.
    • getAttachments

      Map<String,Object> getAttachments()
      Provides access to the full Map of consumer attachments in an unmodifiable Map instance. If no attachments are assigned to the consumer an empty Map instance is returned, never null.
      Returns:
      an unmodifiable Map that carries all consumer attachments.