Polling failed with RequestError

Hi

I am following the tutorial Executing automated steps (2/6) | docs.camunda.org

When I type “node ./worker.js” I get an error message “polling failed with RequestError”. See below.
polling
V subscribed to topic charge-card
polling
? polling failed with RequestError: connect ECONNREFUSED 127.0.0.1:8080

Regards.

The file worker.js contains the following :
const { Client, logger } = require(‘camunda-external-task-client-js’);

// configuration for the Client:
// - ‘baseUrl’: url to the Process Engine
// - ‘logger’: utility to automatically log important events
const config = { baseUrl: ‘http://localhost:8080/engine-rest’, use: logger };

// create a Client instance with custom configuration
const client = new Client(config);

// susbscribe to the topic: ‘charge-card’
client.subscribe(‘charge-card’, async function({ task, taskService }) {
// Put your business logic here

// Get a process variable
const amount = task.variables.get(‘amount’);
const item = task.variables.get(‘item’);

console.log(Charging credit card with an amount of ${amount}€ for the item '${item}'...);

// Complete the task
await taskService.complete(task);
});

Hi, can somebody help me on that problem ?
Thank you.

Do you have the camunda platform running when you start your worker?
Is it deployed on SpringBoot or an application service like Wildfly/Tomcat?

Hi,

The camunda platform was not running. Now it is all fine, thank you !

Hi @chipniz can you help me how did u resolved the issue, how you made camunda engine start running. Am doing the code in visual code.

You can download and startup one of the following distro’s of Camunda.

Hi
I did not resolved the issue.
Regards.

1 Like

Can you explain exactly what you’ve done and exactly what happens when you do it?

Hi @Niall, can you give some samples where get inputs and send to service task to call another API(POST call) , wait for response and call another API (POST call) etc.
Need bpnm file with javascripting, not java code as no complex logic involved than calling continuously APIs. Also it will be good, if it has some gateway when not 200 print some error message using inline scrpting.