3

please give me some advice about the best pattern of the task solution. My task is this:

  1. User makes a request to the Camunda processor through own rest controller
  2. BPMN schema on a backend side consists of a chain of several asynchronous services
  3. Data will be ready for response to the User only when one final service on BPMN makes it.

Every chain works not greater than 10-15 secs. And users sessions count is less than 500 an hour.

How to organize the work of the rest controller? Is it acceptable to force controller waiting of result in the same call? Where a bottleneck?

Deep Parsania
  • 253
  • 2
  • 12
  • Deep Parsania, thank you! – Alexander Fedyukov Jan 09 '20 at 08:27
  • Good question but is it really specific to Camunda or for that matter even java and even Spring (I completely understand that you must be encountering this in relation with your Camunda project)? May be you should consider to remove additional tags. – Chadwick Robbert Jan 09 '20 at 14:32

1 Answers1

2

Can you use some server push technology? If it were just a couple of seconds, I'd say go for waiting in the rest controller.

Being 15 seconds and thinking about scalability, I'd say to follow some kind of asynchronous pattern with the client to.

  1. Client sends a request to do something
  2. The controller delegates the work to some external process and returns to the client ok
  3. The process ends and a response is ready.
  4. If the other side is a browser, use some kind of server push technology to notify it. If it is an application use some kind of rpc, polling or any other inter process mechanism to communicate.

Note that depending on the hosting technology, there are different limits on concurrent connections. Check Spring Boot - Limit on number of connections created for tomcat.

Athanasios Kataras
  • 25,191
  • 4
  • 32
  • 61
  • Unfortunately, our application is developed for closed contour - without access to internet. That is why for example Google cloud messaging can't be used to task solution. I'm looking on websockets, but hope that some server side trick exists. – Alexander Fedyukov Jan 09 '20 at 08:38
  • 1
    You don't need access to the internet for messaging.Check https://www.rabbitmq.com/ which works on prem as well as cloud. Websockets is the server push solution I'm talking about. – Athanasios Kataras Jan 09 '20 at 08:56