Skip to content

Add abstract coroutine class and have ImplBase extend it#1

Open
cengdall-blaze wants to merge 1 commit into
bindservice-finalfrom
abstractimpl
Open

Add abstract coroutine class and have ImplBase extend it#1
cengdall-blaze wants to merge 1 commit into
bindservice-finalfrom
abstractimpl

Conversation

@cengdall-blaze
Copy link
Copy Markdown
Collaborator

@cengdall-blaze cengdall-blaze commented Apr 29, 2025

Spring application is failing to start when bindService is final:

WARN: Unable to proxy interface-implementing method [public final io.grpc.ServerServiceDefinition com.backblaze.ServiceImplBase.bindService()] because it is marked as final, consider using interface-based JDK proxies instead.

CGLIB proxies are required to apply Spring AOP to grpc service implementations if there isn't an interface. Wire's output (as well as that of gprc-java) generates an abstract class, so Spring is attempting to generate CGLIB proxies and failing due to not being able to override the bindService method.

This change has ImplBase extend an abstract class when generating suspending calls, which itself implements WireBindableService. This is a similar pattern to what is being done by grpc-java.

Spring application is failing to start when bindService is final:

```
WARN: Unable to proxy interface-implementing method [public final io.grpc.ServerServiceDefinition com.backblaze.ServiceImplBase.bindService()] because it is marked as final, consider using interface-based JDK proxies instead.
```

CGLIB proxies are required to apply Spring AOP to grpc service implementations
if there isn't an interface. Wire's output (as well as that of gprc-java)
generates an abstract class, so Spring is attempting to generate CGLIB proxies
and failing due to not being able to override the bindService method.

This change hsa `ImplBase` extend an abstract class when generating suspending
calls, which itself implements `WireBindableService`. This is a similar pattern
to what is being done by grpc-java.
@cengdall-blaze cengdall-blaze self-assigned this Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant