项目作者: ottogiron

项目描述 :
Metrics workers processor
高级语言: Go
项目地址: git://github.com/ottogiron/metricsworker.git
创建时间: 2017-04-06T04:19:06Z
项目社区:https://github.com/ottogiron/metricsworker

开源协议:

下载


Metrics Workers

A set of workers processing metrics from RabbitMQ.

Available worker are:

  • distinctName
  • hourlyLog
  • accountName

Note: Workers consume and process metrics from a single queue concurrently.

Build Status
GoDoc
Go Report Card

Install

Download and install from the releases page

Dependencies

  • RabbitMQ
  • Redis
  • MongoDB
  • PostgreSQL

For testing purposes you can run the docker compose development file docker-compose.dev.yml

  1. docker-compose -f docker-compose.dev.yml up -d

Example

  1. mworker --concurrency=1 \
  2. --wait-timeout=600 \
  3. --rabbit-uri=amqp://guest:guest@localhost:5672 \
  4. --rabbit-queue_name=hello \
  5. --rabbit-consumer_auto_ack=true \
  6. --rabbit-exchange="test-exchange" \
  7. --rabbit-routing_key="test-key"

Usage

  1. mworker [flags]
  2. Flags :
  3. -concurrency int
  4. Number of concurrent set of workers running (default 1)
  5. -mongo-events-db string
  6. mongo events database (default "events")
  7. -mongo-host string
  8. mongo host localhost (default "localhost")
  9. -postgres-db string
  10. postgres database (default "postgres")
  11. -postgres-host string
  12. postgres host (default "localhost")
  13. -postgres-password string
  14. postgres password (default "mysecret")
  15. -postgres-user string
  16. postgres user (default "postgres")
  17. -rabbit-binding_wait
  18. Binding wait
  19. -rabbit-consumer_auto_ack
  20. Consumer Auto ACK
  21. -rabbit-consumer_no_local
  22. Consumer no local
  23. -rabbit-consumer_no_wait
  24. Consumer no wait
  25. -rabbit-consumer_tag string
  26. Consumer tag
  27. -rabbit-exchange string
  28. Exchange name. If exchange name is empty all other exchange flags are ignored
  29. -rabbit-exchange_delete_when_complete
  30. Exchange delete when complete
  31. -rabbit-exchange_durable
  32. Exchange durable (default true)
  33. -rabbit-exchange_internal
  34. Exchange internal
  35. -rabbit-exchange_no_wait
  36. Exchange no wait
  37. -rabbit-exchange_type string
  38. Exchange type - direct|fanout|topic|x-custom (default "direct")
  39. -rabbit-queue_delete_when_used
  40. Queue delete queue when used
  41. -rabbit-queue_durable
  42. Queue durable
  43. -rabbit-queue_exclusive
  44. Queue exclusive
  45. -rabbit-queue_name string
  46. Rabbit queue name (default "hello-queue")
  47. -rabbit-queue_no_wait
  48. Queue no wait
  49. -rabbit-routing_key string
  50. Routing Key
  51. -rabbit-uri string
  52. Rabbit instance uri e.g. amqp://guest:guest@localhost:5672/ (default "amqp://guest:guest@localhost:5672/")
  53. -redis-address string
  54. Redis address example localhost:6779 (default "localhost:6379")
  55. -redis-db int
  56. Redis DB
  57. -wait-timeout int
  58. Time to wait in miliseconds until new jobs are available in rabbit (default 500)