trivago / gollum

An n:m message multiplexer written in Go
http://gollum.readthedocs.org/en/latest/
Apache License 2.0
940 stars 74 forks source link

is documentation outdated? #240

Closed serii833 closed 5 years ago

serii833 commented 5 years ago

is documentation outdated? I'm trying "Hello World" examples and they don't seem to be correct. I was able to run them with config tweaking. I've found some other inconsistencies through docs. Am I missing something?

andygrunwald commented 5 years ago

Hey @serii833, can you provide us a little bit more information? E.g.,

serii833 commented 5 years ago

my Gollum version 0.5.3 (precompiled binary)

I take first example from this page https://gollum.readthedocs.io/en/latest/src/examples/helloWorld.html

- "consumer.Console":
    Stream: "console"

- "producer.Console":
    Formatter: "format.Envelope"
    Stream:
        - "*"
        - "_GOLLUM_"

when i try to run Gollum with this config I've got following:

[2018-12-18 22:44:14 +03] ERROR Failed to read config error=yaml: unmarshal errors:
  line 1: cannot unmarshal !!seq into map[string]tcontainer.MarshalMap

after making config to look like this

"consumer.Console":
  Type: consumer.Console
  Streams: 
    - "console"

"producer.Console":
  Type: producer.Console
  # Formatter: "format.Envelope"
  # ERROR Failed to instantiate producer 'producer.Console' error=Unknown configuration key 'Formatter' in 'producer.Console'
  Streams:
    - "*"
    - "_GOLLUM_"

Gollum starts and working

Another example this page https://gollum.readthedocs.io/en/latest/src/gen/consumer/console.html describes "console" consumer. There is parameter "Modulators" among others.

Defines a list of modulators to be applied to a message

there is no "modulators" section in docs, but there is a "filters" section. I made assumption that modulator are filters and it made sense.

M3t0r commented 5 years ago

Yeah, it seems that the examples are still using the old v0.4 keywords although the general structure has been updated. The transformation is mentioned in the release notes.

format.Envelope is a modulator that you can specify in the modulators list of consumers and producers. Check the example for format.Envelope.

Your config should then look like this:

"consumer.Console":
  Type: consumer.Console
  Streams: 
    - "console"

"producer.Console":
  Type: producer.Console
  Modulators:
    - format.Envelope
  Streams:
    - "*"
    - "_GOLLUM_"

Filters and formatters are both modulators. The documentation hierarchy isn't very clear in that regard.

arnecls commented 5 years ago

The examples have been updated to 0.5.x format along with the 0.5.4 release. Thanks for pointing this out 👍