azure-sdk-for-js icon indicating copy to clipboard operation
azure-sdk-for-js copied to clipboard

[storage-queue] queue improvements

Open ljian3377 opened this issue 4 years ago • 1 comments

Quoting Kamil,

https://github.com/Azure/azure-sdk-for-net/issues/14211 (one message): I was working in a codebase in .NET where I had a need to receive/peek just one message and found that it requires lot of repetitive code to achieve such a simple thing. So I went ahead and added such convenience. I can see that we already have something like that in Java but not in Python. I think in .NET and Java this is needed as compiler makes you write too much code to just request 1 message and extract it from collection. I’m not sure how hectic is this in Python and JS, so I suggest to give it a try and see if it improves CX – if it does then I suggest adding that.

As for base64 encoding. We have a prototype in .NET how this would look like here https://github.com/Azure/azure-sdk-for-net/pull/14476 . In addition to base64 knob in options it also brings in “BinaryData” which gives an abstraction to serialize/deserialize to/from byte array. In V11 we used to have ability to send queue messages with byte arrays, so this is going to bring back that option (plus some other benefits). The BinaryData started in the Azure.Core but they ended up adding it to .NET https://github.com/dotnet/designs/pull/155 . BinaryData is not yet shipped but as soon as it is we’re going to add this to Queue SDK. As far as I know there is BinaryData concept in Java https://github.com/Azure/azure-sdk-for-java/blob/4600d55e77a44e51cd458e9e6a94ebf5e1553774/sdk/core/azure-core-experimental/src/main/java/com/azure/core/experimental/util/BinaryData.java#L57 (still work in progress). For Python and JS I think we should follow up with One SDK crews to see what’s the equivalent of BinaryData. I suspect there might be none since both can take “union types” (i.e. you can pass string or byte array without adding overload) – in that case we could go ahead and implement base64 encoding in those languages as a QueueClient options knob (see initial .NET PR for reference https://github.com/Azure/azure-sdk-for-net/pull/14476 ). But I’d wait until .NET goes first and use it as a base how to model this in other languages (i.e. how to name new client options).

ljian3377 avatar Nov 06 '20 09:11 ljian3377

https://github.com/Azure/azure-sdk-for-net/pull/16689

ljian3377 avatar Nov 10 '20 02:11 ljian3377