logstash-plugins / logstash-input-sqs

Apache License 2.0
16 stars 40 forks source link

Testing logstash-input-sqs with ElasticMQ-SQS locally #45

Closed devopsberlin closed 6 years ago

devopsberlin commented 6 years ago

I am developing an application that uses the Amazon Simple Queue Service (SQS) for testing locally without having to connect to the real SQS every time.

https://s3-eu-west-1.amazonaws.com/softwaremill-public/elasticmq-server-0.13.8.jar

Could you please add queue_url option for example http://sqs-local:80/queue/#{queue_name} to allow polling from the sqs on your localhost ?

Thanks

jsvd commented 6 years ago

I believe this will be solved by allowing customizing the endpoint. Support for this has been merged in https://github.com/logstash-plugins/logstash-mixin-aws/pull/32

phillipsnick commented 6 years ago

Just to confirm this works well 👍

My working config for anyone attempting the same

logstash pipeline

input {
  sqs {
    endpoint => "http://sqs:9324"
    queue => "logs"
  }
}

elasticmq.conf

include classpath("application.conf")

// node-address.host = "*" means the server will take "Host" header of incoming
// requests to generate queue URLs.
node-address {
    protocol = http
    host = "*"
    port = 9324
    context-path = ""
}

queues {
  logs {}
}