Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

added kafka ascoltatore #144

Merged
merged 26 commits into from
May 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
cbfebb3
added kafka ascoltatore
Mar 22, 2016
ed60703
added kafka install
Mar 22, 2016
19634f4
producer no longer created lazily since it is impacting travis tests
Mar 22, 2016
983440a
avoid publishing to a closed ascoltatore
Mar 22, 2016
6389c7e
use event listener to determine when the consumer has connected
fullergalway Mar 30, 2016
f249355
reworked kafka ascoltatore to create topics as required
fullergalway Mar 31, 2016
1de2ca2
removed console log message
fullergalway Mar 31, 2016
def785c
added encoding on documentation
fullergalway Mar 31, 2016
205b5b5
benign change to trigger travis build
Apr 1, 2016
48a9dde
benign change to trigger travis build
Apr 1, 2016
c6953fb
try build with node 0.12.12 which worked previously
Apr 1, 2016
39553bb
reverting change to .travis.yml
Apr 1, 2016
97f462d
try upgrading the os before testing
fullergalway Apr 1, 2016
db2e9cf
update installation before runnig tests
fullergalway Apr 1, 2016
50d56dd
update installation before runnig tests
fullergalway Apr 1, 2016
cb64b50
try newer gcc
fullergalway Apr 1, 2016
b74674f
try newer gcc
fullergalway Apr 1, 2016
8ce3274
try newer gcc
fullergalway Apr 1, 2016
ca23053
reverting .travis.yml with MONGO2.6 and 3.0 commented
fullergalway Apr 1, 2016
80be903
commenting node 0.12
fullergalway Apr 1, 2016
3c00497
Try build with node 0.12 and gcc-4.8
fullergalway Apr 6, 2016
db3a6be
reverting
fullergalway Apr 6, 2016
473e841
Update README.md
fullergalway Apr 11, 2016
42913aa
use nan 2.2.0
fullergalway Apr 11, 2016
b88b5b6
Update package.json
fullergalway Apr 11, 2016
680c7fb
Re-adding mongodb versions into travis build
fullergalway Apr 11, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ before_install:
- if [ "$MONGODB_VERSION" = "3.0*" ]; then echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list; fi
- if [ "$MONGODB_VERSION" = "3.2*" ]; then echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/testing multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.1.list; fi
- sudo apt-get update -qq
- wget http://www.us.apache.org/dist/kafka/0.9.0.1/kafka_2.11-0.9.0.1.tgz -O kafka.tgz
- mkdir -p kafka && tar xzf kafka.tgz -C kafka --strip-components 1
- nohup bash -c "cd kafka && bin/zookeeper-server-start.sh config/zookeeper.properties &"
- sleep 10
- nohup bash -c "cd kafka && bin/kafka-server-start.sh config/server.properties &"
- sleep 10

install:
- sudo apt-get install libzmq3-dev
Expand Down
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Ascoltatori is a simple publish/subscribe library supporting the following broke
* [RabbitMQ](http://www.rabbitmq.com/) and all implementations of the [AMQP](http://www.amqp.org/) protocol.
* [ZeroMQ](http://www.zeromq.org/) to use Ascoltatori in a P2P fashion.
* [QlobberFSQ](https://github.com/davedoesdev/qlobber-fsq), a shared file system queue.
* [Apache Kafka](http://kafka.apache.org), a high-throughput distributed messaging system.
* Memory-only routing, using [Qlobber](https://github.com/davedoesdev/qlobber).

Find out more about Ascoltatori reading the
Expand Down Expand Up @@ -289,6 +290,32 @@ require('ascoltatori').build({ json: false }, function(err, a) {
});
```

### Apache Kafka

```javascript
var ascoltatori = require('ascoltatori');
var settings = {
type: 'kafka',
json: false,
kafka: require("kafka-node"),
connectString: "localhost:2181",
clientId: "ascoltatori",
groupId: "ascoltatori",
defaultEncoding: "utf8",
encodings: {
image: "buffer"
}
};

ascoltatori.build(settings, function (err, ascoltatore) {
// ...
});
```

If you publish to a kafka topic that doesn't exist, that topic will be created using the default settings.

If you subscribe to a kafka topic that doesn't exist, that subscription will take affect only when something is published to the kafka topic through this ascoltatori.

## Domain support

Ascoltatori supports the [node.js domain API](http://nodejs.org/api/domain.html).
Expand Down Expand Up @@ -336,6 +363,7 @@ The following debug flags are supported:
* `ascoltatori:zmq`
* `ascoltatori:ee2`
* `ascoltatori:filesystem`
* `ascoltatori:kafka`


## Reliability
Expand All @@ -362,6 +390,7 @@ Use the [issue tracker](http://github.com/mcollina/ascoltatori/issues) for bugs.
* [Mosquitto](http://mosquitto.org/)
* [RabbitMQ](http://www.rabbitmq.com/)
* [ZeroMQ](http://www.zeromq.org/)
* [Apache Kafka](http://kafka.apache.org/)


## Authors
Expand Down
2 changes: 2 additions & 0 deletions lib/ascoltatori.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module.exports.MongoAscoltatore = require('./mongo_ascoltatore');
module.exports.DecoratorAscoltatore = require("./decorator_ascoltatore");
module.exports.JSONAscoltatore = require("./json_ascoltatore");
module.exports.FileSystemAscoltatore = require("./filesystem_ascoltatore");
module.exports.KafkaAscoltatore = require("./kafka_ascoltatore");

/**
*
Expand All @@ -33,6 +34,7 @@ var classes = {
"redis": module.exports.RedisAscoltatore,
"zmq": module.exports.ZeromqAscoltatore,
"mongo": module.exports.MongoAscoltatore,
"kafka": module.exports.KafkaAscoltatore,
"filesystem": module.exports.FileSystemAscoltatore
};

Expand Down
Loading