Class EventMeshConsumer


  • public class EventMeshConsumer
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean deregisterClient​(ConsumerGroupClient client)
      Deregister client's topic information and return true if this EventMeshConsumer required restart because of the topic changes
      ServiceState getStatus()  
      void init()  
      boolean registerClient​(ConsumerGroupClient client)
      Register client's topic information and return true if this EventMeshConsumer required restart because of the topic changes
      void sendMessageBack​(java.lang.String consumerGroup, io.cloudevents.CloudEvent event, java.lang.String uniqueId, java.lang.String bizSeqNo)  
      void shutdown()  
      void start()  
      void subscribe​(java.lang.String topic, org.apache.eventmesh.common.protocol.grpc.protos.Subscription.SubscriptionItem.SubscriptionMode subscriptionMode)  
      void unsubscribe​(org.apache.eventmesh.common.protocol.grpc.protos.Subscription.SubscriptionItem subscriptionItem)  
      void updateOffset​(org.apache.eventmesh.common.protocol.grpc.protos.Subscription.SubscriptionItem.SubscriptionMode subscriptionMode, java.util.List<io.cloudevents.CloudEvent> events, org.apache.eventmesh.api.AbstractContext context)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EventMeshConsumer

        public EventMeshConsumer​(EventMeshGrpcServer eventMeshGrpcServer,
                                 java.lang.String consumerGroup)
    • Method Detail

      • registerClient

        public boolean registerClient​(ConsumerGroupClient client)
        Register client's topic information and return true if this EventMeshConsumer required restart because of the topic changes
        Parameters:
        client - ConsumerGroupClient
        Returns:
        true if the underlining EventMeshConsumer needs to restart later; false otherwise
      • deregisterClient

        public boolean deregisterClient​(ConsumerGroupClient client)
        Deregister client's topic information and return true if this EventMeshConsumer required restart because of the topic changes
        Parameters:
        client - ConsumerGroupClient
        Returns:
        true if the underlining EventMeshConsumer needs to restart later; false otherwise
      • init

        public void init()
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • start

        public void start()
                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • shutdown

        public void shutdown()
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • subscribe

        public void subscribe​(java.lang.String topic,
                              org.apache.eventmesh.common.protocol.grpc.protos.Subscription.SubscriptionItem.SubscriptionMode subscriptionMode)
                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • unsubscribe

        public void unsubscribe​(org.apache.eventmesh.common.protocol.grpc.protos.Subscription.SubscriptionItem subscriptionItem)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • updateOffset

        public void updateOffset​(org.apache.eventmesh.common.protocol.grpc.protos.Subscription.SubscriptionItem.SubscriptionMode subscriptionMode,
                                 java.util.List<io.cloudevents.CloudEvent> events,
                                 org.apache.eventmesh.api.AbstractContext context)
                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • sendMessageBack

        public void sendMessageBack​(java.lang.String consumerGroup,
                                    io.cloudevents.CloudEvent event,
                                    java.lang.String uniqueId,
                                    java.lang.String bizSeqNo)
                             throws java.lang.Exception
        Throws:
        java.lang.Exception