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

104
Vistas
handling Any within a protocol buffer with javascript

I'm trying to handle some generic Message values within a wrapping protocol buffer (with nodejs):

message MessageWrapper {
    string id = 1;
    google.protobuf.Any wrapped_message = 2;
    ....
}

as part of this, I have to pack() the Any:

const wrapper = new MessageWrapper();
const wrappedMessage = new Any();
wrappedMessage.pack(msg.serializeBinary(), msgType);

The heart of the problem is the msgType. If I was using java, I could get the msg.getDescriptorForType(), but javascript doesn't seem to support that.. level of self description. Outside of manually supplying the string type url, how does one get it?

Addendum: To be honest I'm not sure what the msgType of pack() is used for. It seems I can put any string value in there and packing and unpacking seem to work fine. What's it for?

about 4 years ago · Juan Pablo Isaza
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