TDAJSONDataStreamer vs TDABin2DataStreamer

Hello,

I don’t understand when I should use TDAJSONDataStreamer or TDABin2DataStreamer on server side and client side.
Is dependent of Message type or an another reason.
Is need to be same on server side and client side?

Hi,

You should use the same streamer and the same message on client and server-side.
Data Streamer is used for writing tables into stream.

I can suggest to use TDABin2DataStreamer and TROBinMessage. it will give the better performance because data was written in binary form.

TDAJSONDataStreamer allows to write tables in JSON format. it gives worse performance in comparing with TDABin2DataStreamer but usable for parsing such data in java or javascript clients.

how things works:

  • table content is written with DataStreamer into stream
  • created stream is written into Message

I need to provide TROBinMessage for delphi clients and
TROJSONMessage for JavaScript clients with de same server.

That means on server side, in TDataAbstractService, I need to recreate DataStreamer in accordance with MessageType?

You can use TDAJSONDataStreamer for all clients (Delphi and JavaScript).

You can add a new message to dispatchers:

as a result, ROBinMessage1 will be used for requests to http://localhost:8099/Bin and ROJSONMessage1 - for requests to http://localhost:8099/JSON

Thanks