{"_id":"ladle","_rev":"6-37691a7ba45466d442c9f0aba08af36c","name":"ladle","dist-tags":{"latest":"0.0.0"},"versions":{"0.0.0":{"name":"ladle","version":"0.0.0","keywords":["rabbitmq amqp shovel ladle"],"author":{"url":"http://ei.ne.ke","name":"Chris Eineke","email":"chris@ei.ne.ke"},"license":"LGPL-3.0","_id":"ladle@0.0.0","maintainers":[{"name":"ceineke","email":"npm@ei.ne.ke"}],"homepage":"https://github.com/ceineke/ladle","bugs":{"url":"http://github.com/ceineke/ladle/issues"},"dist":{"shasum":"52f3f6ca02a6bbcc20ecc5e2ab4362f67f996178","tarball":"https://registry.npmjs.org/ladle/-/ladle-0.0.0.tgz","integrity":"sha512-WjA4d81eci7/Xqvcl82TILjTHHZqncuKdWj1I5u9qjHw4coVYgQuOUw6mAc2z+7pQ9uq3QQyQKsMb1Tb7L8pYQ==","signatures":[{"sig":"MEQCIFZs4BOgTXdoOkxlUrNQBi95XEXGFE8zvLdXz2O1XRJLAiAufG+hGnEMKj1ZRdGcGpZt9xRWHmeMUo6KSgRZQU61nQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./src/ladle.js","_from":".","_shasum":"52f3f6ca02a6bbcc20ecc5e2ab4362f67f996178","engines":{"node":"*"},"gitHead":"39c3f5c3c36121fe3b197a5f141e36e93bde9dba","scripts":{"test":"grunt test"},"_npmUser":{"name":"ceineke","email":"npm@ei.ne.ke"},"repository":{"url":"http://github.com/ceineke/ladle","type":"git"},"_npmVersion":"1.4.28","description":"Node.js implementation of RabbitMQ's shovel client.","directories":{},"dependencies":{"when":"~3.7.2","amqplib":"~0.3.2","winston":"~0.9.0","underscore":"~1.8.2","check-types":"~3.1.1"},"devDependencies":{"grunt":"~0.4.5","mocha":"~2.2.1"}}},"time":{"created":"2015-04-04T03:56:04.191Z","modified":"2026-06-11T10:40:34.696Z","0.0.0":"2015-04-04T03:56:04.191Z"},"bugs":{"url":"http://github.com/ceineke/ladle/issues"},"author":{"url":"http://ei.ne.ke","name":"Chris Eineke","email":"chris@ei.ne.ke"},"license":"LGPL-3.0","homepage":"https://github.com/ceineke/ladle","keywords":["rabbitmq amqp shovel ladle"],"repository":{"url":"http://github.com/ceineke/ladle","type":"git"},"description":"Node.js implementation of RabbitMQ's shovel client.","maintainers":[{"email":"vojtech@miksu.cz","name":"miksu"}],"readme":"# ladle\n---\nA Node.js implementation of RabbitMQ's shovel client.\n\n## What it is\nRabbitMQ comes with a programmable AMQP client ([the Shovel plugin](https://www.rabbitmq.com/shovel.html)) that picks up\nmessages from one or more source brokers and drops them off in one or more destination brokers. Ladle provides the same\nfunctionality as RabbitMQ's shovel plugin, but as a standalone Node.js implementation.\n\n## What it does\nLadle acts as a bridge between two or more AMQP brokers. It picks up messages from one or more *source brokers* and\ndrops off them off at one or more *destination brokers*.\n\n## Features\n- [x] Basic message pumping.\n- [ ] SSL.\n- [ ] Pre-startup declarations.\n- [ ] JSON-based configuration.\n- [ ] Standalone systemd service.\n- [ ] Use it as part of your program.\n\n## How to use\n\n### As a dependency\nIf you want to use ladle as part of your own program, you can use ```npm``` to install it and automatically add to your\nlist of dependencies:\n```\nnpm install --save ladle\n```\nThen you can copy and paste this example into your code and adjust the configuration as appropriate:\n```\nvar ladle = require(\"ladle\");\nvar myLadle = ladle.create({\n    ladleName: \"test\",\n    sources: {\n        brokers: [ \"amqp://user1:user1@host1\" ],\n        declarations: []\n    },\n    destinations: {\n        brokers: [ \"amqp://user2:user2@host2\" ],\n        declarations: []\n    },\n    queue: \"myWorkQueue\",\n    publishFields: {\n        exchange: \"my_direct\",\n        routingKey: \"from_ladle\"\n    }\n});\nmyLadle.setRunning(true);\n```\nThis will create and start a ladle named ```test``` that will\n1. Connect to the AMQP broker running on ```host1``` using the username ```user1``` and password ```user1``` as the\n   credentials.\n2. Connect to the AMQP broker running on ```host2``` using the username ```user2``` and password ```user2``` as the\n   credentials.\n3. Consume messages from the queue named ```myWorkQueue``` on ```host1```.\n4. Re-publish messages in the exchange named ```my_direct``` with the rouing key ```from_ladle```.\n\n### As a standalone application\nIf you want to use ladle as a standalone application, you can use ```npm``` to install it globally instead:\n```\nnpm install -g ladle\n```\nThen you have to create a configuration file at ```/etc/ladle/ladle.conf```. You can use one of the provided example\nconfigurations for simpler setup. The file is a JSON document mirroring the configuration you saw above in the usage\nexample. The ladle configuration lets you create one or more ladles at a time.\n```\n[ { ladleName: \"test\",\n    sources: {\n        brokers: [ \"amqp://user1:user1@host1\" ],\n        declarations: []\n    },\n    destinations: {\n        brokers: [ \"amqp://user2:user2@host2\" ],\n        declarations: []\n    },\n    queue: \"myWorkQueue\",\n    publishFields: {\n        exchange: \"my_direct\",\n        routingKey: \"from_ladle\"\n    } } ]\n```\nThis creates a ladle just as above.\n\n### Ladle configuration\n* ```ladleName``` the name of the ladle. (required)\n* ```sources``` the source brokers, ie. where messages are consumed. (required)\n  * ```brokers``` an array of AMQP URIs in string form. (required)\n  * ```declarations``` an array of AMQP methods to be run on each broker after the ladle has established a connection to\n  the source brokers. Defaults to none. (optional)\n* ```destinations``` the destination brokers, ie. where messages are re-published. (required)\n  * ```brokers``` an array of AMQP URIs in string form. (required)\n  * ```declarations``` an array of AMQP methods to be run on each broker after the ladle has established a connection to\n  the destination brokers. (optional)\n* ```queue```: the name of the message queue to consume messages from. (required)\n* ```prefetchCount```: number of messages to prefetch and keep in-flight between brokers. Defaults to 1000. (optional)\n* ```ackMode```: How consumed messages are acknowledged. Defaults to ```onConfirm```. (optional)\n* ```publishProperties```: Properties set on the basic.properties on each re-published message. (optional)\n* ```addForwardHeaders```: If ```true```, an ```x-ladled``` header is appended or added to the message. Defaults to\n```false```. (Optional)\n* ```publishFields```: Fields set on the basic.publish method. By default, messages are re-published using the original\nexchange name and routing key. (Optional)\n* ```reconnectDelay```: the number of seconds to wait before reconnecting. Defaults to 1.5s. (Optional)\n\n## How to contribute\n\n### Code style\nLadle source code largely follows the [Crockford style guide](http://javascript.crockford.com/code.html) with the\nfollowing exceptions:\n* Line length is extended to 120 characters.\n* Semicolon insertion might as well not exist.\n* Variables are defined when they're needed, not at the top of a function.\n\n### Contributions\nPlease read the following before you're contributing:\n> By contributing to this project, you, the contributor, assign the copyright of your contribution, including but not\n> restricted to source code and documentation, to me, Chris Eineke. In return, I grant you a world-wide, non-exclusive,\n> royalty-free and perpetual right to use, copy, modify, communicate and make available to the public (including\n> without limitation via the Internet) and distribute, in each case in an original or modified form, the\n> contribution as you wish.\nIf that hasn't scared you off, fork this repo and create a pull request. If you are contributing code, you must provide\na passing unit test or must make appropriate changes to existing unit tests. Don't forget to add yourself to the\n```contributors``` in ```package.json```.\n","readmeFilename":"README.md"}