Emit events to an Event Message Bus with Foxx Apps

61 views
Skip to first unread message

Florian

unread,
Mar 3, 2016, 1:13:21 PM3/3/16
to ArangoDB
Hi !

Since it's a microservice good practice, I was wondering if it's possible to post & receive events to/from an external Event Message Bus inside a Foxx app, using AMQP or something else.

I tried to import the node amqp module in a Foxx app to post message to my external Event Bus but the amqp module doesn't seem to work.

Is there another way to post and receive events from any external event bus ? ( instead of making HTTP calls )

Thanks !
Florian

Alan Plum

unread,
Mar 8, 2016, 8:29:52 AM3/8/16
to ArangoDB
Hi Florian,

currently ArangoDB can only communicate with external services via HTTP.

The reason node modules that perform network I/O won't work in Foxx is that while ArangoDB shares the same JS engine as Node (V8) it doesn't offer the same abstractions on top of it.
The only way to make network requests in ArangoDB is using the `org/arangodb/request` module (there is no compatible equivalent of node's http or https modules).

Additionally JavaScript in ArangoDB is always executed synchronously (whereas in Node you typically use callbacks, especially when performing network requests which may incur latency).

I have explained some of the differences between Node and Foxx in the webinar: https://www.youtube.com/watch?v=Hq612XJBmIw


Cheers,

Alan
Reply all
Reply to author
Forward
0 new messages