TDAJSONDataStreamer vs TDABin2DataStreamer

delphi
(tstoicescu) #1

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?

0 Likes

(EvgenyK) #2

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
0 Likes

(tstoicescu) #3

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?

0 Likes

(EvgenyK) #4

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

0 Likes

(tstoicescu) #5

Thanks

0 Likes