Skip to content

Conversation

@pimmerks
Copy link
Contributor

@pimmerks pimmerks commented May 19, 2023

We are building an application that exposes it's own gRPC service, it also needs to subscribe to the dapr pub/sub component.

Currently we are allowed to set the listener, but this is not enough, as we found that about half of the time, our own gRPC server responds, and the other half of the time the dapr service responds with an unknown service xxx.xxx.

If this is merged, the user is allowed to set their own grpcServer with the NewServiceWithGrpcServer() func.

In action:

lis, _ := net.Listen("tcp", "localhost:8080")
server := grpc.NewServer()

// Register dapr
dapr.NewServiceWithGrpcServer(lis, server)

// Setup dapr subscriptions here

// Register own services
proto.RegisterOwnServer1(server, ownServer1{})
proto.RegisterOwnServer2(server, ownServer2{})

go server.Serve(lis)

In issue #237 the same problem has been found.

@pimmerks pimmerks requested a review from a team as a code owner May 19, 2023 13:07
Copy link
Contributor

@JoshVanL JoshVanL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pimmerks, this seems like a sensible extension to me 🙂

@codecov
Copy link

codecov bot commented May 20, 2023

Codecov Report

Merging #400 (4f65fbd) into main (f6dccfd) will increase coverage by 0.05%.
The diff coverage is 90.90%.

@@            Coverage Diff             @@
##             main     #400      +/-   ##
==========================================
+ Coverage   68.93%   68.98%   +0.05%     
==========================================
  Files          31       31              
  Lines        2479     2483       +4     
==========================================
+ Hits         1709     1713       +4     
  Misses        676      676              
  Partials       94       94              
Impacted Files Coverage Δ
service/grpc/service.go 59.64% <90.90%> (+3.04%) ⬆️

@yaron2 yaron2 merged commit b2275e7 into dapr:main May 20, 2023
@yaron2
Copy link
Member

yaron2 commented May 25, 2023

Thanks for this contribution @pimmerks

@yaron2 yaron2 added this to the 1.8 milestone Jun 1, 2023
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.

3 participants