Skip to content

Is it possible to get raw message buffers in client methods? #87

Answered by aikoven
nurbo asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, this is definitely possible, though it would create some problems with typings.

When you create a client, you pass a service definition, which contains method descriptors that have serialize and deserialize methods. You could bake your own service definition where these methods are identities, something like (type checks ignored):

const client = clientFactory.create(
  {
    someMethod: {
      path: '/some.package.SomeService/SomeMethod',
      requestStream: false,
      responseStream: false,
      requestSerialize: value => value,
      requestDeserialize: value => value,
      responseSerialize: value => value,
      responseDeserialize: value => value,
      options: {},
    },

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nurbo
Comment options

Answer selected by nurbo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants