Package org.opennms.core.ipc.sink.api
Interface MessageConsumerManager
-
- All Known Implementing Classes:
AbstractMessageConsumerManager
,AmazonSQSMessageConsumerManager
,CamelMessageConsumerManager
,KafkaMessageConsumerManager
,MockMessageConsumerManager
,OpennmsGrpcServer
,OsgiIpcManager
public interface MessageConsumerManager
Handles dispatching of messages to the registered consumer(s).- Author:
- jwhite
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
LOG_PREFIX
static java.lang.String
METRIC_DISPATCH_TIME
static java.lang.String
METRIC_MESSAGE_SIZE
static java.lang.String
METRIC_MESSAGES_RECEIVED
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description <S extends Message,T extends Message>
voiddispatch(SinkModule<S,T> module, T message)
static com.codahale.metrics.Timer
getDispatchTimerMetric(com.codahale.metrics.MetricRegistry metricRegistry, java.lang.String location, java.lang.String moduleId)
<S extends Message,T extends Message>
voidregisterConsumer(MessageConsumer<S,T> consumer)
<S extends Message,T extends Message>
voidunregisterConsumer(MessageConsumer<S,T> consumer)
static void
updateMessageSize(com.codahale.metrics.MetricRegistry metricRegistry, java.lang.String location, java.lang.String moduleId, int messageSize)
-
-
-
Field Detail
-
LOG_PREFIX
static final java.lang.String LOG_PREFIX
- See Also:
- Constant Field Values
-
METRIC_MESSAGES_RECEIVED
static final java.lang.String METRIC_MESSAGES_RECEIVED
- See Also:
- Constant Field Values
-
METRIC_MESSAGE_SIZE
static final java.lang.String METRIC_MESSAGE_SIZE
- See Also:
- Constant Field Values
-
METRIC_DISPATCH_TIME
static final java.lang.String METRIC_DISPATCH_TIME
- See Also:
- Constant Field Values
-
-
Method Detail
-
dispatch
<S extends Message,T extends Message> void dispatch(SinkModule<S,T> module, T message)
-
registerConsumer
<S extends Message,T extends Message> void registerConsumer(MessageConsumer<S,T> consumer) throws java.lang.Exception
- Throws:
java.lang.Exception
-
unregisterConsumer
<S extends Message,T extends Message> void unregisterConsumer(MessageConsumer<S,T> consumer) throws java.lang.Exception
- Throws:
java.lang.Exception
-
updateMessageSize
static void updateMessageSize(com.codahale.metrics.MetricRegistry metricRegistry, java.lang.String location, java.lang.String moduleId, int messageSize)
-
getDispatchTimerMetric
static com.codahale.metrics.Timer getDispatchTimerMetric(com.codahale.metrics.MetricRegistry metricRegistry, java.lang.String location, java.lang.String moduleId)
-
-