@InterfaceAudience.LimitedPrivate @InterfaceStability.Evolving public interface BrokerInterceptor extends AutoCloseable
BrokerInterceptor callbacks may be called from multiple threads. Interceptor implementation must ensure thread-safety, if needed.
| Modifier and Type | Interface and Description |
|---|---|
static class |
BrokerInterceptor.BrokerInterceptorDisabled
Broker interceptor disabled implementation.
|
| Modifier and Type | Field and Description |
|---|---|
static BrokerInterceptor |
DISABLED |
| Modifier and Type | Method and Description |
|---|---|
default void |
beforeSendMessage(Subscription subscription,
Entry entry,
long[] ackSet,
org.apache.pulsar.common.api.proto.PulsarApi.MessageMetadata msgMetadata)
Intercept messages before sending them to the consumers.
|
void |
close()
Close this broker interceptor.
|
void |
initialize(PulsarService pulsarService)
Initialize the broker interceptor.
|
void |
onConnectionClosed(ServerCnx cnx)
Called by the broker while connection closed.
|
void |
onPulsarCommand(org.apache.pulsar.common.api.proto.PulsarApi.BaseCommand command,
ServerCnx cnx)
Called by the broker while new command incoming.
|
void |
onWebserviceRequest(javax.servlet.ServletRequest request)
Called by the web service while new request incoming.
|
void |
onWebserviceResponse(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
Intercept the webservice response before send to client.
|
static final BrokerInterceptor DISABLED
default void beforeSendMessage(Subscription subscription, Entry entry, long[] ackSet, org.apache.pulsar.common.api.proto.PulsarApi.MessageMetadata msgMetadata)
subscription - pulsar subscriptionentry - entryackSet - entry ack bitset. it is either null or an array of long-based bitsets.msgMetadata - message metadata. The message metadata will be recycled after this call.void onPulsarCommand(org.apache.pulsar.common.api.proto.PulsarApi.BaseCommand command,
ServerCnx cnx)
throws org.apache.pulsar.common.intercept.InterceptException
org.apache.pulsar.common.intercept.InterceptExceptionvoid onConnectionClosed(ServerCnx cnx)
void onWebserviceRequest(javax.servlet.ServletRequest request)
throws IOException,
javax.servlet.ServletException,
org.apache.pulsar.common.intercept.InterceptException
IOExceptionjavax.servlet.ServletExceptionorg.apache.pulsar.common.intercept.InterceptExceptionvoid onWebserviceResponse(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
throws IOException,
javax.servlet.ServletException
IOExceptionjavax.servlet.ServletExceptionvoid initialize(PulsarService pulsarService) throws Exception
Exception - when fail to initialize the broker interceptor.void close()
close in interface AutoCloseableCopyright © 2017–2021 Apache Software Foundation. All rights reserved.