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.
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.
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.
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.