snippets_js
Listener
New listener
const listener = await yepcode.listener.awsSqs('yepcode-sqs-listener');
Start listener with callback message
const callback = (message) => console.log('New message received:', { message });
listener.start(callback);
Start listener with callback message and onCallbackError
const callback = (message) => console.log('New message received:', { message });
const onCallbackError = (error, message) =>
console.error(
"[Process] Error: '%s', processing message: %s",
error.message,
message
);
listener.start(callback, { onCallbackError });
Stop listener
listener.stop();