You need to call `enableRetry()` on the channel builder. See the retry example <https://github.com/grpc/grpc-java/blob/f3a1a3ff10ee07383aad3a51afb3fbbc7fe3d0db/examples/src/main/java/io/grpc/examples/retrying/RetryingHelloWorldClient.java#L74> and example config <https://github.com/grpc/grpc-java/blob/f3a1a3ff10ee07383aad3a51afb3fbbc7fe3d0db/examples/src/main/resources/io/grpc/examples/retrying/retrying_service_config.json> .
I think your methodConfig may not be selected because there is no 'name' list for methods to match. Now that we support wildcard service names, you could probably use methodConfig.put("name", Arrays.asList(Collections.emptyMap())). I'll note that reconnect attempts are completely separate from RPC retries. gRPC always has reconnect behavior enabled. On Wed, Sep 30, 2020 at 8:39 AM 'Mark D. Roth' via grpc.io < grpc-io@googlegroups.com> wrote: > As per discussion earlier in this thread, we haven't yet finished > implementing the retry functionality, so it's not yet enabled by default. > I believe that in Java, you may be able to use it, albeit with some > caveats. Penn (CC'ed) can tell you what the current status is in Java. > > On Wed, Sep 30, 2020 at 8:35 AM Guillermo Romero < > guillermo.rom...@gmail.com> wrote: > >> Thanks Mark: >> >> So. >> what's level this retry policy works?. >> >> >> final Map<String, Object> retryPolicy = new HashMap<>(); >> retryPolicy.put("maxAttempts", 10D); >> retryPolicy.put("initialBackoff", "10s"); >> retryPolicy.put("maxBackoff", "30s"); >> retryPolicy.put("backoffMultiplier", 2D); >> retryPolicy.put("retryableStatusCodes", Arrays.<Object>asList( >> "UNAVAILABLE" , "RESOURCE_EXHAUSTED" , "INTERNAL")); >> final Map<String, Object> methodConfig = new HashMap<>(); >> methodConfig.put("retryPolicy", retryPolicy); >> >> final Map<String, Object> serviceConfig = new HashMap<>(); >> serviceConfig.put("methodConfig", Collections.<Object>singletonList( >> methodConfig)); >> >> I'm having a problem with netty client, it thows an exception when tcp >> breaks an not try to reconnect N times (MaxAttemps) - >> >> >> >> El miércoles, 30 de septiembre de 2020 a las 12:09:25 UTC-3, Mark D. Roth >> escribió: >> >>> gRPC client channels will automatically reconnect to the server when the >>> TCP connection fails. That has nothing to do with the retry feature, and >>> it's not something you need to configure -- it will happen automatically. >>> >>> Now, if an individual request is already in-flight when the TCP >>> connection fails, that will cause the request to fail. And in that case, >>> retrying the request would be what you want. >>> >>> On Wed, Sep 30, 2020 at 6:01 AM Guillermo Romero <guillerm...@gmail.com> >>> wrote: >>> >>>> Hi: >>>> I'm using Jboss Netty as Grpc client, and my doubts are related to >>>> the Retry Policy. My understanding is that the Retry Policy is related to >>>> the internal message transport between the client and the server using the >>>> gRPC protocol. >>>> But my problem is related to the TCP breaks, there is a way of write a >>>> TCP retry policy? >>>> >>>> >>>> El viernes, 10 de febrero de 2017 a las 21:31:01 UTC-3, >>>> ncte...@google.com escribió: >>>> >>>>> I've created a gRFC describing the design and implementation plan for >>>>> gRPC Retries. >>>>> >>>>> Take a look at the gRPC on Github >>>>> <https://github.com/grpc/proposal/pull/12>. >>>>> >>>> -- >>>> >>> You received this message because you are subscribed to the Google >>>> Groups "grpc.io" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to grpc-io+u...@googlegroups.com. >>>> >>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/grpc-io/33fc1235-073a-48ca-b387-b964b74e366fn%40googlegroups.com >>>> <https://groups.google.com/d/msgid/grpc-io/33fc1235-073a-48ca-b387-b964b74e366fn%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> >>> >>> -- >>> Mark D. Roth <ro...@google.com> >>> Software Engineer >>> Google, Inc. >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "grpc.io" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to grpc-io+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/grpc-io/6319a287-42c4-424d-8f40-3dfd97a8be5dn%40googlegroups.com >> <https://groups.google.com/d/msgid/grpc-io/6319a287-42c4-424d-8f40-3dfd97a8be5dn%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > > > -- > Mark D. Roth <r...@google.com> > Software Engineer > Google, Inc. > > -- > You received this message because you are subscribed to the Google Groups " > grpc.io" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to grpc-io+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/grpc-io/CAJgPXp44%3DNF95XfmGCk4nzBCuO89HaR886XSKeYZMCC-i6m3Fg%40mail.gmail.com > <https://groups.google.com/d/msgid/grpc-io/CAJgPXp44%3DNF95XfmGCk4nzBCuO89HaR886XSKeYZMCC-i6m3Fg%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/CA%2B4M1oPhQx%3DVG3SSR0EKVV6kzDkc3R%2BY2YWwpVHqY9kuTfjYuA%40mail.gmail.com.
smime.p7s
Description: S/MIME Cryptographic Signature