B4J Question B4J programs communicating using MicroService architecture

aiguy

New Member
Has anyone written any B4J programs running in MicroService architecture where one B4J program (controller) can start a new B4J program (worker) that will run on a different CPU core and then the controller can pass messages to the second worker program and receive results back from in the form of a message.

Because each worker process has to read in a good bit of data when it first starts. it would not be efficient to just let the worker process exit and shutdown after each message. Instead the worker processes would not shut down until the controller sends them a message that it is ready to shutdown.

I have a program that runs too slowly on a single core and I would like to distribute the workload across several cores to reduce the response time.
 

aiguy

New Member
What is your program doing? Maybe there is a simpler solution.
It is a chatbot that uses the Levenshtein algorithm to calculate the edit distance between the user's input and thousands of pattern.

I now have 23,569 patterns the number grows every day.

I want to break the pattern list up between 10 cores and pass the user input to each of the workers.

Each work will return the closest pattern and distance to the users input.

To do this it has to execute the Levenshtein Algorithm on the UserInput and each pattern keeping the pattern that has the shortest distance from the user input and returning it once it has calculated the distance for all patterns.

When all ten have returned I will have program execute the code template that corresponds to the closest pattern returned.

Right now the language I am using does not have capability for MicroServices. And my response times using a single core has reached as high a 40 seconds but shorter user inputs are still in the 2 to 3 second range.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…