Permalink
Browse files

added long polling

  • Loading branch information...
berndruecker committed Jan 8, 2019
1 parent ef03aad commit 63813d5ec2cef357410a59ba59f6aa8645084b62
@@ -1,7 +1,7 @@
var request = require('request');
const { Client, Variables } = require("camunda-external-task-client-js");

const config = { baseUrl: "http://localhost:8100/rest/engine/default", interval: 50};
const config = { baseUrl: "http://localhost:8100/rest/engine/default", interval: 50, asyncResponseTimeout: 10000};
const client = new Client(config);

client.subscribe("customer-credit", async function({ task, taskService }) {
@@ -15,7 +15,10 @@

public static void main(String[] args) throws InterruptedException {
// bootstrap the client
ExternalTaskClient client = ExternalTaskClient.create().baseUrl(BASE_URL).build();
ExternalTaskClient client = ExternalTaskClient.create() //
.baseUrl(BASE_URL) //
.asyncResponseTimeout(5000) // long polling interval
.build();

// subscribe to the topic
client.subscribe("customer-credit") //

0 comments on commit 63813d5

Please sign in to comment.