External Task Client creating 2000+ logs per second

Hi

I have an external task client which subscribes to topics.
Below is a sample subscription in my App.java (the client class)

	client.subscribe("emailListener").lockDuration(10000).handler((externalTask, externalTaskService) -> {

			<--my business logic--->
			externalTaskService.complete(externalTask);
			System.out.println("The External Task Email Listener " + externalTask.getId() + " has been completed!");

		}).open();

There are multiple subscriptions like this in the same App.java (for each topic). The code works fine.

But the problem is, when deployed on the server, it is producing way too many logs per second in my localhost_access_log.2018-07-16.txt file… around 2500 logs .

Eg:
127.0.0.1 - - [16/Jul/2018:03:59:16 +0000] “POST /engine-rest/external-task/fetchAndLock HTTP/1.1” 200 12
127.0.0.1 - - [16/Jul/2018:03:59:16 +0000] “POST /engine-rest/external-task/fetchAndLock HTTP/1.1” 200 12
127.0.0.1 - - [16/Jul/2018:03:59:16 +0000] “POST /engine-rest/external-task/fetchAndLock HTTP/1.1” 200 12
127.0.0.1 - - [16/Jul/2018:03:59:16 +0000] “POST /engine-rest/external-task/fetchAndLock HTTP/1.1” 200 12
127.0.0.1 - - [16/Jul/2018:03:59:16 +0000] “POST /engine-rest/external-task/fetchAndLock HTTP/1.1” 200 12
127.0.0.1 - - [16/Jul/2018:03:59:16 +0000] “POST /engine-rest/external-task/fetchAndLock HTTP/1.1” 200 12
127.0.0.1 - - [16/Jul/2018:03:59:16 +0000] “POST /engine-rest/external-task/fetchAndLock HTTP/1.1” 200 12
127.0.0.1 - - [16/Jul/2018:03:59:16 +0000] “POST /engine-rest/external-task/fetchAndLock HTTP/1.1” 200 12

How can i fix this.?

Thanks

Hi,

You have a couple of options:

  1. Stop logging requests. Look into your application server’s documentation for that.
  2. Configuring the client such that it makes less requests. I guess you have a large number of tasks that are available as soon as the client connects, so they are then immediately executed by the task client. Is that correct? If yes, then you can increase the batch size of how many tasks are fetched at once, see https://github.com/camunda/camunda-external-task-client-java/blob/1.0.0/client/src/main/java/org/camunda/bpm/client/ExternalTaskClientBuilder.java#L55-L62.

Cheers,
Thorben

Thanks. I solved it by disabling access-logs from server.