Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

406
Vistas
Using Kafka in a resquest/response scenario inside a REST web service

I am currently building a REST web service that needs to communicate with Kafka in a request/response pattern. (I know that Kafka is not really designed for that).

  1. Client calls the REST web service.
  2. REST web service publishes a message to Kafka
  3. On the other side of Kafka, an app consumes the message and publishes the response back to Kafka
  4. (inside the same request as #2)REST web service listens to Kakfa and wait for response corresponding to the request
  5. REST web service returns the response to the client

Steps 1 to 3 seems pretty easy but I'm struggling with step 4.

My idea was to propagate an ID in each message so that I could retrieve the response corresponding to the request.

However, I have a hard time figuring out how to set up the listener on the REST web service. How can the listener returns the message to the controller?

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

i think is better just create a topic for each user, then the user can send a message to another service, such message is like:

{
user:"myUserName"
data:"data of message"
}

then the service just need to push to the topic "user.myUserName" Then from the web client just need to be subscribed to "user.myUserName" (with a consumergroup configuration, this just for read only the newest messages )...

i think the best way is just implement websocket and then push/read by that way ;)

Bye and good day.

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda