infinispan / js-client

Javascript client for Infinispan, over the Hot Rod wire protocol
https://infinispan.org/docs/hotrod-clients/js/latest/js_client.html
Apache License 2.0
15 stars 28 forks source link

Implemented protobuf messages encoding functionality #83

Closed NeerajGartia21 closed 2 years ago

NeerajGartia21 commented 2 years ago

This is a follow-up PR of #82 .

The proposed design for put operation in application/x-protostream mediatype is as follows:

  1. register the protobuf schema using the registerProtostream function i.e. client.registerProtostreamType('.awesomepackage.AwesomeMessages',1000042);
  2. Encode the message object using the protobuf schema. i.e var encoded=root.encode(message)
  3. call the put method by providing the encoded message object as the argument. i.e. client.put(encoded)

PUT operation on the client can be used by following above steps.

In this PR the functionality of the PUT operation is added. So now PUT operation can be used using application/x-protostream as mediatype.

Next task

  1. Implement decodeProtobuf for GET operation.
  2. Add unit tests for the new features.
rigazilla commented 2 years ago

@NeerajGartia21 I've added some more commits:

Hey! encoding seems to work very well! Awesome!

if it looks good to you I can merge all this into main

NeerajGartia21 commented 2 years ago

It looks fine to me.

rigazilla commented 2 years ago

merged, thanks @NeerajGartia21 !

NeerajGartia21 commented 2 years ago

Thanks @rigazilla .