README.md in phobos-1.5.0 vs README.md in phobos-1.6.0

- old
+ new

@@ -1,9 +1,11 @@ ![Phobos](https://raw.githubusercontent.com/klarna/phobos/master/logo.png) -[![Circle CI](https://circleci.com/gh/klarna/phobos.svg?style=shield&circle-token=2289e0fe5bd934074597b32e7f8f0bc98ea0e3c7)](https://circleci.com/gh/klarna/phobos/tree/master) -[![Coverage Status](https://coveralls.io/repos/github/klarna/phobos/badge.svg?branch=master)](https://coveralls.io/github/klarna/phobos?branch=master) +[![Build Status](https://travis-ci.org/klarna/phobos.svg?branch=master)](https://travis-ci.org/klarna/phobos) +[![Maintainability](https://api.codeclimate.com/v1/badges/2d00845fc6e7e83df6e7/maintainability)](https://codeclimate.com/github/klarna/phobos/maintainability) +[![Test Coverage](https://api.codeclimate.com/v1/badges/2d00845fc6e7e83df6e7/test_coverage)](https://codeclimate.com/github/klarna/phobos/test_coverage) +[![Chat with us on Discord](https://discordapp.com/api/guilds/379938130326847488/widget.png)](https://discord.gg/rfMUBVD) # Phobos Simplifying Kafka for Ruby apps! @@ -115,10 +117,18 @@ By default, the __start__ command will look for the configuration file at `config/phobos.yml` and it will load the file `phobos_boot.rb` if it exists. In the example above all example files generated by the __init__ command are used as is. It is possible to change both files, use `-c` for the configuration file and `-b` for the boot file. Example: ```sh $ phobos start -c /var/configs/my.yml -b /opt/apps/boot.rb ``` + +You may also choose to configure phobos with a hash from within your boot file. +In this case, disable loading the config file with the `--skip-config` option: + +```sh +$ phobos start -b /opt/apps/boot.rb --skip-config +``` + ### <a name="usage-consuming-messages-from-kafka"></a> Consuming messages from Kafka Messages from Kafka are consumed using __handlers__. You can use Phobos __executors__ or include it in your own project [as a library](#usage-as-library), but __handlers__ will always be used. To create a handler class, simply include the module `Phobos::Handler`. This module allows Phobos to manage the life cycle of your handler. A handler is required to implement the method `#consume(payload, metadata)`. @@ -322,9 +332,23 @@ __listeners__ is the list of listeners configured, each listener represents a consumers group [ruby-kafka-client]: http://www.rubydoc.info/gems/ruby-kafka/Kafka%2FClient%3Ainitialize [ruby-kafka-consumer]: http://www.rubydoc.info/gems/ruby-kafka/Kafka%2FClient%3Aconsumer [ruby-kafka-producer]: http://www.rubydoc.info/gems/ruby-kafka/Kafka%2FClient%3Aproducer + +#### Additional listener configuration + +In some cases it's useful to share _most_ of the configuration between +multiple phobos processes, but have each process run different listeners. In +that case, a separate yaml file can be created and loaded with the `-l` flag. +Example: + +```sh +$ phobos start -c /var/configs/my.yml -l /var/configs/additional_listeners.yml +``` + +Note that the config file _must_ still specify a listeners section, though it +can be empty. ### <a name="usage-instrumentation"></a> Instrumentation Some operations are instrumented using [Active Support Notifications](http://api.rubyonrails.org/classes/ActiveSupport/Notifications.html).