Skip to content

nabriski/ascot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ascot

Apache Camel in Node over GraalVM

Image of Ascot Cigarette

Install

TBD

Run

TBD

Usage

Use With Node Processor

const {CamelContext,createRouteBuilder,createProcessor} = require("ascot");
const camelContext = new CamelContext();
const request = require("superagent");

(async ()=>{

  const procFunc = async (exchange)=>{
    const resp = await request.get('http://api.icndb.com/jokes/random').accept('application/json');
    const str = `${resp.body.value.joke}`;
    exchange.getMessage().setBody(str);
    return;
  }
  const processor = await createProcessor(procFunc);

  const route = createRouteBuilder({
    configure: function () {
      const inst = Java.super(route);
      inst
        .from("timer://foo?fixedRate=true&period=10000")
        .process(processor)
        .log("${body}")
        .to("file:output");
    },
  });
  camelContext.addRoutes(route);
  camelContext.start();
})();

About

Apache Camel in Node over GraalVM

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published