RestEasy003210 Error

I am trying to implement an external task worker for nodejs from Camunda worker node. My camuda bpe is up & running.

The engine does not seem to be up as i am getting

{“type”:“NotFoundException”,“message”:“RESTEASY003210: Could not find resource for full path: http://localhost:8080/engine-rest”}

How can i fix this?

Thank you

@Bisoux from postman try to access this api:

GET http://localhost:8080/engine-rest/engine

I am getting a status 200 OK

From external worker which API you’re trying to access?

I am trying to access the worker api as follows,

var Workers = require('camunda-worker-node');
var Backoff = require('camunda-worker-node/lib/backoff');

try {
    console.log('In try  ');
    // console.log('Is ' + Backoff);
    var engineEndPoint = process.env.ENGINE_URL || 'http://localhost:8080/engine-rest';
}
catch (e) {
    console.log(e)
}

console.log("Out of try");

var uuid = require('uuid');

var workers = new Workers(engineEndPoint);

//console.log(workers);

try {
    console.log('in backoff');
    Backoff(workers);
}
catch (e) {
    console.log(e);
}

workers.subscribe('FightTribe', ['name'], function (context, callback) {
    console.log("in worker subscribe");
    if (Math.random() > 0.9) {
        console.log('German Tribe Fighter, The Battle is lost.');
        return callback(null, {
            variables: {
                legionStatus: "defeated"
            }
        });
    }
    console.log('German Tribe Fighter, The Battle is WON.');

    callback(null, {
        variables: {
            legionStatus: 'Victorious'
        }
    })
});

So the execution hangs at the call to function

Backoff(workers)

@Bisoux refer the below example for camunda-external-task-client-js and refer this blog external-tasks.

1 Like

Implemented the example as shown on the repo you linked. It looks like this is working. Thank you