EventStore / EventStoreDB-Client-Java

Official Asynchronous Java 8+ Client Library for EventStoreDB 20.6+
https://eventstore.com
Apache License 2.0
61 stars 19 forks source link

Support user-provided gRPC client interceptors. #233

Closed YoEight closed 1 year ago

YoEight commented 1 year ago

Added: Support user-provided gRPC client interceptors.

You can know pass your gRPC interceptor(s) in 2 different ways, depending on how you create your connection settings instance.

connection string

    EventStoreDBClientSettings settings = EventStoreDBClientSettings.parseOrThrow("{connection string}")

    settings.getInterceptors().add(myGrpcClientInterceptor);

    EventStoreDBClient client = EventStoreDBClient.create(settings);

   // rest of your application

connection builder

   EventStoreDBClientSettings settings = EventStoreDBClientSettings.newBuilder()
       .addInterceptor(myGrpcClientInterceptor)
       .buildConnectionSettings();

   EventStoreDBClient client = EventStoreDBClient.create(settings);

   // rest of your application