
Package ca.uhn.fhir.broker.api
Interface IChannelConsumer<T>
- Type Parameters:
T
- The type of messages received by this consumer
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
SpringMessagingReceiverAdapter
Receives messages from a Message Broker.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
Consumers should call this method at the top of any method that attempts to use the consumervoid
close()
Close this consumer's listener and this consumer, releasing any resources.boolean
isClosed()
default void
pause()
Pause requesting new messages from the broker until resume() is called.default void
resume()
Resume requesting messages from the broker.void
start()
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 interfaceAutoCloseable
-
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
Pause requesting new messages from the broker until resume() is called. -
resume
Resume requesting messages from the broker. -
checkState
Consumers should call this method at the top of any method that attempts to use the consumer
-