5

Like the title says.

Is there a way to use gRPC in combination with some kind of message broker/ Queue with .NET?

It does not have to be RabbitMQ. I am open to use alternatives.

enter image description here\

I want to send messages from 1 client to 2 servers but i need to prevent that the 2 servers process the request at the same time, hence the message queue/broker.

2
  • 1
    gRPC is not part of the protocols RabbitMQ supports : rabbitmq.com/protocols.html Commented Oct 1, 2020 at 8:45
  • yeah that i what i thought unfortunately Commented Oct 1, 2020 at 11:45

3 Answers 3

0

You could do this with Azure Service Bus. Client could be on-premises or in Azure. Same for servers 1 and 2.

Note: You should be able to gRPC to Azure Service Bus, but you may need to use HTTP/REST function for topic/subscription to send messages to Server 1 or 2.

Another approach to consider:

https://grpc.io/blog/grpc-load-balancing/

Sign up to request clarification or add additional context in comments.

1 Comment

Didn't actually answer the question.
0

I think to best answer your question, I assume the reason why you want to use rabbitmq with grpc is because you'd like to have better decoupling from client to servers while still using rpc pattern. With this in mind, this might be something you actually need:

  1. rabbitmq - rpc pattern (could find tutorial from rabbitmq docs)
  2. google protobuf to be your contracts between services

The idea is that client is connected to the queue with two channels, one is to send message where you can specify the destination to be a specific service (in your scenario service1); two is a reply channel where service1 would be sending message back to the client.

Comments

0

Kafka and the confuent platform supports grpc and google proto-buffer as a serialization schema.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.