GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Using Pub/Sub JAVA client in play framework 2.5 - netty conflicts · Issue #1331 · googleapis/google-cloud-java

Using Pub/Sub JAVA client in play framework 2.5 - netty conflicts #1331

New issue
Copy link
New issue
Copy link
Closed
Closed
Using Pub/Sub JAVA client in play framework 2.5 - netty conflicts#1331
Copy link
Assignees
garrettjonesgoogle
Labels
api: loggingIssues related to the Cloud Logging API.api: pubsubIssues related to the Pub/Sub API.dependenciespriority: p2Moderately-important priority. Fix may not be included in next release.status: blockedResolving the issue is dependent on other work.triaged for GAtype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Description

@g-lok
g-lok
opened on Oct 21, 2016
Issue body actions

Issue summary: Client's services are built on top of the play framework 2.5. Some of their services need to publish messages to pub/sub, but the Google Pub/Sub java api depends on netty 4.1.x, which conflicts with netty 4.0.x used by play framework 2.5.
Is there a solution to get around this?

Reacted by Matt Feury and Les Vogel

Activity

Next
  1. mziccard commented on Oct 21, 2016

    @mziccard
    mziccard
    on Oct 21, 2016
    Contributor
    More actions

    Argh @thefunkjunky I need to be honest with you, I was expecting this issue...

    This is a problem with gRPC (a dependency of ours) and Play 2.5. gRPC depends on netty 4.1, while Play 2.5 depends on netty 4.0. Unfortunately, these 2 netty versions are not binary compatible.

    A possible solution (see stackoverflow) could be downgrading to Play 2.4.6 which uses netty 3.8.0 that had a completely different project structure and package names (hence no name clashes).

    Play 2.6 should ship with netty 4.1 and possibly solve this issue.

    @garrettjonesgoogle do you know whether gRPC people considered shading some of their dependencies? There seem to be a number of people encountering this compatibility issues.

  2. garrettjonesgoogle commented on Oct 21, 2016

    @garrettjonesgoogle
    garrettjonesgoogle
    on Oct 21, 2016
    Contributor
    More actions

    I don't know - @ejona86 , can you comment?

  3. ejona86 commented on Oct 21, 2016

    @ejona86
    ejona86
    on Oct 21, 2016
    Contributor
    More actions

    So shading is a fine strategy, but since Netty is exposed through our API (e.g., you can provide your own EventLoopGroup to NettyChannelBuilder), gRPC project pre-shading can cause problems.

  4. garrettjonesgoogle
    added
    api: pubsubIssues related to the Pub/Sub API.
    on Nov 23, 2016
  5. garrettjonesgoogle commented on Jan 26, 2017

    @garrettjonesgoogle
    garrettjonesgoogle
    on Jan 26, 2017
    Contributor
    More actions

    We may have to shade all of gRPC in google-cloud-java. There are two problematic dependencies:

    1. Guava
    2. Netty (also see: Netty incompatibility when using Pub/Sub with Dataproc #1522 - Netty conflict with Spark Google Dataproc)
  6. garrettjonesgoogle
    assigned
    pongad
    on Jan 26, 2017
  7. garrettjonesgoogle
    added
    blocking GA
    on Jan 26, 2017
  8. ejona86 commented on Jan 27, 2017

    @ejona86
    ejona86
    on Jan 27, 2017
    Contributor
    More actions

    I have since made grpc/grpc-java#2485. It's not submitted yet, and if you use NettyChannelBuilder directly it doesn't work well, but we can maybe push harder on that.

    Guava is a different story. Would I be right to assume issues are caused by the ancient guava-jdk5 used by the v1 client libraries?

  9. garrettjonesgoogle commented on Jan 27, 2017

    @garrettjonesgoogle
    garrettjonesgoogle
    on Jan 27, 2017
    Contributor
    More actions

    The issue with Guava isn't the guava-jdk5 dependency, it is a larger issue with the Guava deprecation policy. Basically as soon as we pick a particular version of Guava and expose types from it, that means no one can mix our library with a version of Guava that is 2 years older or 2 years newer than the version we picked. There are a fair number of consumers that this doesn't work for, e.g. Hadoop which is stuck on Guava 11.

    Reacted by Tsz-Wo Nicholas Sze
  10. ejona86 commented on Jan 27, 2017

    @ejona86
    ejona86
    on Jan 27, 2017
    Contributor
    More actions

    and expose types from it

    You can't do that at all, if you are going to shade. So for example, it is hard to shade Guava for gRPC when the Future stub is in play, because it uses ListenableFuture but if we shade ListenableFuture then none of the normal utilities will work and users have to use our shaded version.

  11. garrettjonesgoogle commented on Jan 27, 2017

    @garrettjonesgoogle
    garrettjonesgoogle
    on Jan 27, 2017
    Contributor
    More actions

    Our plan was to create an interface analogous to ListenableFuture called https://github.com/googleapis/gax-java/blob/master/src/main/java/com/google/api/gax/grpc/RpcFuture.java , which allows users to add callbacks, and make a bridge from ListenableFuture to RpcFuture called https://github.com/googleapis/gax-java/blob/master/src/main/java/com/google/api/gax/grpc/ListenableFutureDelegate.java (which is package-private). What do you mean by "the normal utilities?"

  12. ejona86 commented on Jan 31, 2017

    @ejona86
    ejona86
    on Jan 31, 2017
    Contributor
    More actions

    Hadoop which is stuck on Guava 11.

    I think the argument there is that Hadoop should be shading/using class loading magic (a la containers). Because without doing so nobody can mix Hadoop and Guava. But I do understand the general "exposing a dependency on Guava can cause problems" argument.

    Our plan was to create an interface analogous to ListenableFuture called RpcFuture

    Okay. And then your users can create their own utility to convert that to a ListenableFuture.

    What do you mean by "the normal utilities?"

    I mean things like cgc.util.concurrent.Futures. There are a lot of generic utility methods that do things with ListenableFutures.

    make a bridge from ListenableFuture to RpcFuture called ListenableFutureDelegate

    That's an implementation detail, right? The user of your library doesn't care about that at all, right?

    Note that any reason you are using ListenableFuture in your code could be an example of why your users would want ListenableFuture.

  13. garrettjonesgoogle commented on Jan 31, 2017

    @garrettjonesgoogle
    garrettjonesgoogle
    on Jan 31, 2017
    Contributor
    More actions

    Hadoop which is stuck on Guava 11.

    I think the argument there is that Hadoop should be shading/using class loading magic (a la containers). Because without doing so nobody can mix Hadoop and Guava. But I do understand the general "exposing a dependency on Guava can cause problems" argument.

    Hadoop's problem isn't just that it depends on Guava, it's that it made Guava part of its surface, so if it upgrades to a newer version of Guava, it's a breaking change for its users. If it was only an implementation detail, they could have done something like shading Guava a long time ago.

    Our plan was to create an interface analogous to ListenableFuture called RpcFuture

    Okay. And then your users can create their own utility to convert that to a ListenableFuture.

    I was considering creating a "bridge" project that depends on Guava and connects GAX features to Guava, so that each user doesn't have to do it themselves.

    What do you mean by "the normal utilities?"

    I mean things like cgc.util.concurrent.Futures. There are a lot of generic utility methods that do things with ListenableFutures.

    Right, but people don't have to use those utilities. This could be addressed with the "bridge" project I mentioned above.

    make a bridge from ListenableFuture to RpcFuture called ListenableFutureDelegate

    That's an implementation detail, right? The user of your library doesn't care about that at all, right?

    That is correct.

    Note that any reason you are using ListenableFuture in your code could be an example of why your users would want ListenableFuture.

    The key thing that comes out of ListenableFuture is the capability of adding a callback so that a thread isn't consumed. I don't think the key is so much that exact interface as that we provide the callback capability.

  14. kuroneko25 commented on Feb 9, 2017

    @kuroneko25
    kuroneko25
    on Feb 9, 2017
    More actions

    I ran into a similar issue where I use grpc-all 1.1.2 and google-cloud-pubsub in the same project. Is this going to be addressed by grpc/grpc-java#2485?

    Specifically this exception

    Exception in thread "main" java.lang.NoSuchMethodError: io.grpc.netty.NettyChannelBuilder.build()Lio/grpc/internal/ManagedChannelImpl;
        at com.google.api.gax.grpc.InstantiatingChannelProvider.createChannel(InstantiatingChannelProvider.java:119)
        at com.google.api.gax.grpc.InstantiatingChannelProvider.getChannel(InstantiatingChannelProvider.java:106)
        at com.google.api.gax.grpc.ProviderManager.getChannel(ProviderManager.java:106)
        at com.google.api.gax.grpc.ChannelAndExecutor.create(ChannelAndExecutor.java:67)
        at com.google.api.gax.grpc.ClientSettings.getChannelAndExecutor(ClientSettings.java:78)
        at com.google.cloud.pubsub.spi.v1.PublisherClient.<init>(PublisherClient.java:182)
        at com.google.cloud.pubsub.spi.v1.PublisherClient.create(PublisherClient.java:173)
    
  15. pongad commented on Feb 9, 2017

    @pongad
    pongad
    on Feb 9, 2017
    Contributor
    More actions

    If I understand this correctly, the answer is yes.

    The exception is NoSuchMethod not NoClassDef. So I'm guessing

    1. grpc and gax depends on different versions
    2. grpc's version takes precedence
    3. grpc's version doesn't have the build() method we need

    Once that issue is addressed, things will work together again.

    ccing @garrettjonesgoogle to make sure I'm diagnosing this correctly.

  16. 45 remaining items

  17. suztomo
    added 2 commits that reference this issue on Mar 11, 2026

    chore(java): update release_type choices to stable and preview (googl…

    4b7ee71

    chore(deps): update dependency com.google.cloud:google-cloud-logging …

    68b625d
  18. chingor13
    added a commit that references this issue on Mar 12, 2026

    chore(java): update release_type choices to stable and preview (#1331) (

    f3c35dd
  19. lqiu96
    added a commit that references this issue on Mar 20, 2026

    feat: Java datastore gapic upgrade (#1824)

    b80fba0
  20. suztomo
    added 2 commits that reference this issue on Mar 23, 2026

    fix: comments should be sent to Spanner for PostgreSQL databases (goo…

    1f80c57

    chore(main): release 2.13.0 (googleapis#1345)

    79ed936
  21. suztomo
    added a commit that references this issue on Mar 30, 2026

    deps: update dependency com.google.cloud:google-cloud-shared-dependen…

    eb6ead9
  22. lqiu96
    added a commit that references this issue on Apr 1, 2026

    deps: update dependency com.google.cloud:google-cloud-shared-dependen…

    8eaae29
  23. meltsufin
    added 4 commits that reference this issue on Apr 29, 2026

    chore(java): update release_type choices to stable and preview (#1331) (

    b38305b

    chore(main): release 1.120.20-SNAPSHOT (#1331)

    7a87a17

    chore(java): update release_type choices to stable and preview (#1331) (

    6791b10

    chore(main): release 1.120.20-SNAPSHOT (#1331)

    243ec55
  24. benjaminp
    added 3 commits that reference this issue on Jul 13, 2026

    chore(java): update release_type choices to stable and preview (googl…

    1c275d9

    chore(main): release 2.10.2-SNAPSHOT (googleapis#1331)

    1facba8

    feat: Support Cloud Bigtable Changestream (googleapis#1569)

    99071f0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @garrettjonesgoogle
    garrettjonesgoogle

Labels

api: loggingIssues related to the Cloud Logging API.api: pubsubIssues related to the Pub/Sub API.dependenciespriority: p2Moderately-important priority. Fix may not be included in next release.status: blockedResolving the issue is dependent on other work.triaged for GAtype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.