Skip to content

Repository files navigation

BatchElixir

Send transactional notifications to Batch

Installation

If available in Hex, the package can be installed by adding batch_elixir to your list of dependencies in mix.exs:

defdepsdo[{:batch_elixir,"~> 0.2.0"}]end
defapplicationdo[applications: [:batch_elixir]]end

Configuration

config:batch_elixir,rest_api_key: "rest api key",# Required, if not provided the application fail to startdevices: "your rest api key of batch",# requireddefault_deeplink: "myapp://"# required,producer_name: BatchElixir.Server.Producer,# name of the producer. By default the producer is BatchElixir.Server.Producerconsumer_options: [],# extra options for GenStage as consumer. Typically [min_demand:10, max_demand: 100]producer_options: [],# extra options for GenStage as producer. Typically [buffer_size: 10_000]batch_url: "https://api.batch.com/1.1/",# Base url of batch apiretry_interval_in_milliseconds: 1_000,# Interval between each failed requestsmax_attempts: 3,# Maximum attempts of failed requestsnumber_of_consumers: 1,# Number of consumers to pop. By default is 1stats_driver: BatchElixir.Stats.Memory# BatchElixir.Stats.Memory For In memory stats or BatchElixir.Stats.Statix to send to datadog via Statix

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/batch_elixir.

Behaviour testing

For behaviour test please refers to README.md

Stress test

If you want a stub for batch check README.md.

To run the test

mixbenchmark--configstress_test/config.json[--observer]--maxnumber_of_consumersnumber_of_notificationnumber_of_iterations
  • --config: configuration file
  • --observer: Launche the observer window
  • number_of_consumers: Numer of consumers.
  • number_of_notification: Numer of notifications to send.
  • number_of_iterations: Numer of iterations to run.

You also have bash script that will run 1, 10, 100, 1000, 10000, 1000000 notifications with 10, 100, 1000 consumers each.

./stress_test.sh [--observer]

Warns and errors will be outputed to the file: stress_test.log

About

Batch Elixir SDK

Resources

Stars

2 stars

Watchers

9 watching

Forks

Releases

Packages

Contributors

Languages