
Package ca.uhn.fhir.broker.impl
Class LinkedBlockingBrokerClient
java.lang.Object
ca.uhn.fhir.broker.impl.LinkedBlockingBrokerClient
- All Implemented Interfaces:
IBrokerClient
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> IChannelConsumer<T>
getOrCreateConsumer
(String theChannelName, Class<? extends ca.uhn.fhir.rest.server.messaging.IMessage<T>> theMessageType, IMessageListener<T> theMessageListener, ChannelConsumerSettings theChannelConsumerSettings) Create a consumer that receives messages from the channel.<T> IChannelProducer<T>
getOrCreateProducer
(String theChannelName, Class<? extends ca.uhn.fhir.rest.server.messaging.IMessage<T>> theMessageType, ChannelProducerSettings theChannelProducerSettings) Create a producer that is used to send messages to the channel.void
setLinkedBlockingChannelFactory
(LinkedBlockingChannelFactory theLinkedBlockingChannelFactory)
-
Constructor Details
-
LinkedBlockingBrokerClient
-
-
Method Details
-
getOrCreateConsumer
public <T> IChannelConsumer<T> getOrCreateConsumer(String theChannelName, Class<? extends ca.uhn.fhir.rest.server.messaging.IMessage<T>> theMessageType, IMessageListener<T> theMessageListener, ChannelConsumerSettings theChannelConsumerSettings) Description copied from interface:IBrokerClient
Create a consumer that receives messages from the channel.Implementations can choose to return the same object for multiple invocations of this method when invoked with the same theChannelName if they need to, or they can create a new instance.
- Specified by:
getOrCreateConsumer
in interfaceIBrokerClient
- Parameters:
theChannelName
- The actual underlying channel nametheMessageType
- The object type that will be placed on this chanel. Objects will usually be a Jackson-annotated class.theMessageListener
- The message handler that will be called for each arriving message. If more than one message listeners is required for a single consumer,MultiplexingListener
can be used for the listener.theChannelConsumerSettings
- Defines the consumer configuration (e.g. number of listening threads)
-
getOrCreateProducer
public <T> IChannelProducer<T> getOrCreateProducer(String theChannelName, Class<? extends ca.uhn.fhir.rest.server.messaging.IMessage<T>> theMessageType, ChannelProducerSettings theChannelProducerSettings) Description copied from interface:IBrokerClient
Create a producer that is used to send messages to the channel.Implementations can choose to return the same object for multiple invocations of this method when invoked with the same theChannelName if they need to, or they can create a new instance.
- Specified by:
getOrCreateProducer
in interfaceIBrokerClient
- Parameters:
theChannelName
- The actual underlying channel nametheMessageType
- The object type that will be placed on this channel. Objects will be Jackson-annotated structures.theChannelProducerSettings
- Contains the configuration for senders.
-
getChannelNamer
- Specified by:
getChannelNamer
in interfaceIBrokerClient
- Returns:
- the IChannelNamer used by this broker client.
-
setLinkedBlockingChannelFactory
@Autowired public void setLinkedBlockingChannelFactory(LinkedBlockingChannelFactory theLinkedBlockingChannelFactory)
-