Class BrokerInterceptorWithClassLoader

  • All Implemented Interfaces:
    java.lang.AutoCloseable, BrokerInterceptor

    public class BrokerInterceptorWithClassLoader
    extends java.lang.Object
    implements BrokerInterceptor
    A broker interceptor with it's classloader.
    • Constructor Detail

      • BrokerInterceptorWithClassLoader

        public BrokerInterceptorWithClassLoader()
    • Method Detail

      • beforeSendMessage

        public void beforeSendMessage​(Subscription subscription,
                                      org.apache.bookkeeper.mledger.Entry entry,
                                      long[] ackSet,
                                      org.apache.pulsar.common.api.proto.MessageMetadata msgMetadata)
        Description copied from interface: BrokerInterceptor
        Intercept messages before sending them to the consumers.
        Specified by:
        beforeSendMessage in interface BrokerInterceptor
        Parameters:
        subscription - pulsar subscription
        entry - entry
        ackSet - 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.
      • consumerCreated

        public void consumerCreated​(ServerCnx cnx,
                                    Consumer consumer,
                                    java.util.Map<java.lang.String,​java.lang.String> metadata)
        Description copied from interface: BrokerInterceptor
        Intercept after a consumer is created.
        Specified by:
        consumerCreated in interface BrokerInterceptor
        Parameters:
        cnx - client Connection
        consumer - Consumer object
        metadata - A map of metdata
      • messageDispatched

        public void messageDispatched​(ServerCnx cnx,
                                      Consumer consumer,
                                      long ledgerId,
                                      long entryId,
                                      io.netty.buffer.ByteBuf headersAndPayload)
        Description copied from interface: BrokerInterceptor
        Intercept after a message is dispatched to consumer.
        Specified by:
        messageDispatched in interface BrokerInterceptor
        Parameters:
        cnx - client Connection
        consumer - Consumer object
        ledgerId - Ledger ID
        entryId - Entry ID
        headersAndPayload - Data
      • messageAcked

        public void messageAcked​(ServerCnx cnx,
                                 Consumer consumer,
                                 org.apache.pulsar.common.api.proto.CommandAck ackCmd)
        Description copied from interface: BrokerInterceptor
        Intercept after a message ack is processed.
        Specified by:
        messageAcked in interface BrokerInterceptor
        Parameters:
        cnx - client Connection
        ackCmd - Command object
      • onPulsarCommand

        public void onPulsarCommand​(org.apache.pulsar.common.api.proto.BaseCommand command,
                                    ServerCnx cnx)
                             throws org.apache.pulsar.common.intercept.InterceptException
        Description copied from interface: BrokerInterceptor
        Called by the broker while new command incoming.
        Specified by:
        onPulsarCommand in interface BrokerInterceptor
        Throws:
        org.apache.pulsar.common.intercept.InterceptException
      • onWebserviceRequest

        public void onWebserviceRequest​(javax.servlet.ServletRequest request)
                                 throws java.io.IOException,
                                        javax.servlet.ServletException,
                                        org.apache.pulsar.common.intercept.InterceptException
        Description copied from interface: BrokerInterceptor
        Called by the web service while new request incoming.
        Specified by:
        onWebserviceRequest in interface BrokerInterceptor
        Throws:
        java.io.IOException
        javax.servlet.ServletException
        org.apache.pulsar.common.intercept.InterceptException
      • onWebserviceResponse

        public void onWebserviceResponse​(javax.servlet.ServletRequest request,
                                         javax.servlet.ServletResponse response)
                                  throws java.io.IOException,
                                         javax.servlet.ServletException
        Description copied from interface: BrokerInterceptor
        Intercept the webservice response before send to client.
        Specified by:
        onWebserviceResponse in interface BrokerInterceptor
        Throws:
        java.io.IOException
        javax.servlet.ServletException
      • initialize

        public void initialize​(PulsarService pulsarService)
                        throws java.lang.Exception
        Description copied from interface: BrokerInterceptor
        Initialize the broker interceptor.
        Specified by:
        initialize in interface BrokerInterceptor
        Throws:
        java.lang.Exception - when fail to initialize the broker interceptor.
      • close

        public void close()
        Description copied from interface: BrokerInterceptor
        Close this broker interceptor.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface BrokerInterceptor