B4J Question [SERVER] Non-UI Server calling Non-UI Server

AHilton

Active Member
Licensed User
Longtime User
I've been working on a method to offload some processing ...

Server Main shells out to Server Aux which does it's thing and returns a result back to Server Main and then Server Aux quits. This allows many instances of Server Aux to run at the same time, if needed.

Before I delve too deep into it, consider this scenario as an alternative to the above ...

B4X UI Client app calling a B4J Non-UI Server (Server Main) via websocket to perform a task.
Within the B4J Non-UI Server websocket class, it offloads the processing to another B4J Non-UI Server (Server Aux) via websocket.
Once completed, the results are then passed back up the chain to the Client app.
Server Main handles many clients simultaneously and then so would Server Aux by extension, yes?

Can Server Main act as a websocket client at the same time that it's acting as a server?

This system has many clients (B4A / B4I / Web) and Server Main handles them all wonderfully EXCEPT that some functions can take a long time to complete (already optimized) and the fact that if I want to make a change or addition to the abilities, I have to take Server Main down. Doing it as above, I would only have to take down/update Server Aux (actually, there may be many Server Aux's) but leave Server Main responsive to other activities from the Client apps. This way, I only have to have 1 Server Aux running but it has the ability to serve multiple client requests coming from Server Main (just like Server Main does for its' Client Apps).

Thoughts?
 

AHilton

Active Member
Licensed User
Longtime User
Speed isn't the main issue. At least as far as Server Main servicing Client apps is concerned.

Server Main must be located on hardware with certain capabilities and locale.

I'd like the ability to locate Server Aux (maybe many of them) on different hardware in different locales (closer to the resources it needs to perform its' processing, for example). BUT, I want the Client apps to connect only to Server Main. Server Main then can connect to various other servers (Server Aux) to perform specialized duties.

The core product (Client Apps and Server Main ... actually, several Server Mains' with many Client Apps each) has been working pretty well (yes, in Release Mode) for several years but having all server functions contained only in Server Main isn't the most efficient method especially now that the distances, regulations, and updates to certain functions of Server Main have become so widespread and frequent. I'd like to offload some of those in a nicely distributed way.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0
Top