
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 voidConsumers should call this method at the top of any method that attempts to use the consumervoidclose()Close this consumer's listener and this consumer, releasing any resources.booleanisClosed()default voidpause()Pause requesting new messages from the broker until resume() is called.default voidresume()Resume requesting messages from the broker.voidstart()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:
closein 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
IMessageListenerthis 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
-