Simultanious calls from one client?

Hi

I’m creating a service for Magento web shop that can send simultaneous calls to my service.
I was thinking about using TROIndyHTTPServer, TROJSONMessage and TROPooledClassFactory. Currently I’m testing technology utilizing TROClassFactory.

Can my service process simultaneous calls at the same from Magento, or only one call at the time? I’m doubting this since I guess calls from Magento are seen coming from the same client instead of many different clients.

Best Regards

looks like your clients use same message GUID so all requests are treated as if they were sent from one client.

by other hand, TROPooledClassFactory maintains a list of instances of services available to serve requests. Rather than creating a separate instance for each call or always using the same instance, it creates a predefined number of instances and returns the first one currently available to the caller.

as a result, better to not use service variables because they can be used by other clients.
however, it depends on your implementations.

Thank you for your reply.

Is it so, that if one client makes simultaneous calls, only one is processed and others are waiting?
If so, any ideas how to workaround this limitation. Maybe we can do something about the message GUID and give each thread a different guid?

it depends on your implementation.
You can have 10 simultaneous calls in different threads (each thread should have personal instance of channel and message) or 10 consecutive calls in one thread.

yes, this will work. You can assign empty/new guid like

Message.ClientID := NewGuid;  // or EmptyGuid

pls review MegaDemo sample. it shows how to execute several simultaneous calls in different threads.

I assume you mean these on the client side? There is very little I can affect the client side and no reason either. Calls are made from Magento web shop PHP code, so no RemObjects components used there. Unique or empty message.ClientID guid on each client thread call might be enough. It could be that ClientID is already empty.

My focus is on the server side, because that is the part I’m coding.

MAIN QUESTOIN
If client sends simultaneous calls from different threads, will my (basic stateless RemObjects server setup) process them simultaneously or consecutively? I’m aiming for simultaneous processing.

SECOND QUESTION
If client calls with same ClientID are processed consecutively.
How can I see what message.ClientID client is using? I made a test code, where I assign TROJSONMessage OnMessageReadMessageParameter event and convert ClientID to string with GUIDToString( Sender.ClientID ). Is this correct? I’m unsure, because my basic RemObjects client calls show different ClientID each call.

Best Regards
Janne

for non-RO clients, pls specify unique guid.

it depends on used class factory. by default, simultaneously mode is used

You can see it inside any service method, it is ClientID property.

What happens when unique guid is not defined?

Thanks. That was too obvious for me to see :).

Still my basic RemObjects client (no sessions required) calls show different ClientID each call. Should it be like this? I thought the ClientID remains the same as long as my client is running.

Server will generate a new guid for such clients.

only if you set it on client-side and include into json requests for non-RO clients.

Will this create some problems or why should guid be defined (for non-RO clients, pls specify unique guid) ?

Best Regards
Janne

unique guid for each client is required if your server support Sessions.
See more details in Login and Authentication article

Ok. No session support required.

Thank you very much for your fast answers
Janne