Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reject message on failure #7

Open
Recodify opened this issue Oct 9, 2019 · 2 comments
Open

Reject message on failure #7

Recodify opened this issue Oct 9, 2019 · 2 comments
Labels
blocked Issue blocked by one or more other issues enhancement New feature or request plugin:input Issues affecting the Input Plugin

Comments

@Recodify
Copy link

Recodify commented Oct 9, 2019

If a message received by the plugin fails at the output stage (for example, due to an indexing issue in ES), is it possible to have the message rejected so that it is dead-lettered in RabbitMq?

What I'm currently seeing is that a message that fails to be indexed to ES is still ACKed and therefore is lost forever.

  • Version: logstash 6.8.2
  • Operating System: ubuntu 18.04
  • Config File:
input {
    rabbitmq {
      host => "blah.eu-west-2.compute.amazonaws.com"
      queue => "reading-elastic"
      durable => true
      arguments => {
          "x-dead-letter-exchange" => "reading-retry"
          "x-dead-letter-routing-key" => "elastic"
      }
   }
}
filter{
    mutate {
        add_field => {
            "deviceId" => "%{[payload][deviceId]}"
            "readingDate" => "%{[payload][readingDate]}"
            "value" => "%{[payload][value]}"
            "readingTypeId" => "%{[payload][readingTypeId]}"
            "collectionDate" => "%{[payload][collectionDate]}"
            "propertyReference" => "%{[payload][propertyReference]}"
            "propertyId" => "%{[payload][propertyId]}"
            "deviceSerialNumber" => "%{[payload][deviceSerialNumber]}"
            "manufacturerReference" => "%{[payload][manufacturerReference]}"
            "modelReference" => "%{[payload][modelReference]}"
        }

        remove_field => [ "[payload]", "[queuedAt]" ]
    }
    mutate {
        convert => { "value" => "float" }
    }
    date {
        match => [ "readingDate", "UNIX_MS" ]
    }
    date {
        match => [ "collectionDate", "UNIX_MS" ]
        target => "collectionDate"
    }
    date {
        match => [ "readingDate", "UNIX_MS" ]
        target => "readingDate"
    }
}
output {
  elasticsearch { hosts => ["https://blah.eu-west-2.es.amazonaws.com:443"]
                  index => "readings-%{+YYYY.MM.dd}"
  }
}
@ThiagoBarradas
Copy link

I have the same problem as you. I tried with many ways, but I have not success.

Today I opened a topic in elastic discuss, waiting for some help.
https://discuss.elastic.co/t/logstash-rabbitmq-input-send-ack-after-event-processed/203709

If it will not possible, I will try implement it and send a pull request, although I not a expert with ruby.

Thx.

@yaauie
Copy link
Contributor

yaauie commented Nov 21, 2019

There have been efforts in the past to add end-to-end ACKs to Logstash (which the above request would require; elastic/logstash#8514), but these efforts have largely stalled out due to complexity and resulting poor performance.

Without end-to-end acknowledgement in the Logstash pipeline, the Elasticsearch Output Plugin supports the Dead Letter Queue, which persists failed events to disk along-side failure metadata, and the dead_letter_queue Input Plugin can be used in a separate pipeline to hand these events back over to another system or queue for later processing.

@yaauie yaauie transferred this issue from logstash-plugins/logstash-input-rabbitmq Nov 21, 2019
@yaauie yaauie added enhancement New feature or request blocked Issue blocked by one or more other issues plugin:input Issues affecting the Input Plugin labels Nov 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Issue blocked by one or more other issues enhancement New feature or request plugin:input Issues affecting the Input Plugin
Projects
None yet
Development

No branches or pull requests

3 participants