Class EventMeshConsumer
- java.lang.Object
-
- org.apache.eventmesh.runtime.core.protocol.grpc.consumer.EventMeshConsumer
-
public class EventMeshConsumer extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description EventMeshConsumer(EventMeshGrpcServer eventMeshGrpcServer, java.lang.String consumerGroup)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanderegisterClient(ConsumerGroupClient client)Deregister client's topic information and return true if this EventMeshConsumer required restart because of the topic changesServiceStategetStatus()voidinit()booleanregisterClient(ConsumerGroupClient client)Register client's topic information and return true if this EventMeshConsumer required restart because of the topic changesvoidsendMessageBack(java.lang.String consumerGroup, io.cloudevents.CloudEvent event, java.lang.String uniqueId, java.lang.String bizSeqNo)voidshutdown()voidstart()voidsubscribe(java.lang.String topic, org.apache.eventmesh.common.protocol.grpc.protos.Subscription.SubscriptionItem.SubscriptionMode subscriptionMode)voidunsubscribe(org.apache.eventmesh.common.protocol.grpc.protos.Subscription.SubscriptionItem subscriptionItem)voidupdateOffset(org.apache.eventmesh.common.protocol.grpc.protos.Subscription.SubscriptionItem.SubscriptionMode subscriptionMode, java.util.List<io.cloudevents.CloudEvent> events, org.apache.eventmesh.api.AbstractContext context)
-
-
-
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
-
getStatus
public ServiceState getStatus()
-
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
-
-