Interface IChannelConsumer<T>

Type Parameters:
T - The type of messages received by this consumer
All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
SpringMessagingReceiverAdapter

public interface IChannelConsumer<T> extends AutoCloseable
Receives messages from a Message Broker.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Consumers should call this method at the top of any method that attempts to use the consumer
    void
    Close this consumer's listener and this consumer, releasing any resources.
     
     
    Class<? extends ca.uhn.fhir.rest.server.messaging.IMessage<T>>
     
    boolean
     
    default void
    Pause requesting new messages from the broker until resume() is called.
    default void
    Resume requesting messages from the broker.
    void
    Start the thread(s) that will be consuming messages
  • Method Details

    • getChannelName

      Returns:
      the name of the topic or queue that this consumer is consuming from
    • start

      void start()
      Start the thread(s) that will be consuming messages
      Throws:
      ChannelConsumerStartFailureException - if the consumer fails to start (e.g. if it fails to connect to the broker)
    • close

      void close()
      Close this consumer's listener and this consumer, releasing any resources.
      Specified by:
      close in interface AutoCloseable
    • isClosed

      boolean isClosed()
      Returns:
      true if this consumer is closed
    • getMessageType

      Class<? extends ca.uhn.fhir.rest.server.messaging.IMessage<T>> getMessageType()
      Returns:
      the type of messages that will be delivered to this consumer
    • getMessageListener

      Returns:
      the IMessageListener this consumer is sending messages to (i.e. the one it was created with).
    • pause

      default void pause()
      Pause requesting new messages from the broker until resume() is called.
    • resume

      default void resume()
      Resume requesting messages from the broker.
    • checkState

      default void checkState()
      Consumers should call this method at the top of any method that attempts to use the consumer