sashman
Inserting data into Elasticsearch using GenStage, with elasticsearch_elixir_bulk_processor
A while ago I was using Java for an event-based Elasticsearch project. Elastic provides a Java-based library called Bulk Processor, this allows for configurable bulk inserts into Elasticsearch. Unfortunately, the configuration can only be set during instance creation. This inspired me to write an Elixir based equivalent processor which allows the configuration to be changed dynamically during run time. And of course, a good chance to utilize GenStages.
I hope this comes in useful to someone dealing with event sourcing and streams of data, I think this would be a good fit as a sink of data for Broadway based consumers.
Example usage:
alias ElasticsearchElixirBulkProcessor.Items.Index
[
%Index{index: "test_index", source: %{"field" => "value1"}},
%Index{index: "test_index", source: %{"field" => "value2"}},
%Index{index: "test_index", source: %{"field" => "value3"}}
]
|> ElasticsearchElixirBulkProcessor.send_requests()
Feedback and comments are most welcome!
https://github.com/sashman/elasticsearch_elixir_bulk_processor
Popular in Announcing
Hello guys,
I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
Hi!
I wanted to introduce my latest project LiveSvelte. It allows you to render Svelte inside LiveView with end-to-end reactivity. It’s ...
New
What is ContEx?
A pure Elixir server-side data plotting/charting library outputting SVG.
It has nice barcharts in particular and works g...
New
Hey everyone,
I just released WebSockex which is a Elixir WebSocket client.
WebSockex strives to work as a OTP special process, be RFC6...
New
Hello everyone,
We have just released NimbleCSV which is a small and fast CSV parsing library for Elixir. It allows developers to define...
New
Hi, I would like to tell about my initiative to further maintain and develop Waffle project which is the fork of Arc library.
The progre...
New
Hello everybody.
I have just released Jason - a new JSON library.
You might be wondering, why do we need a new library? The primary foc...
New
Hi! :waving_hand:
I would like to present LiveSelect, a little library that I wrote to easily add a dynamic selection input to your LV f...
New
Prometheus metrics and Grafana dashboards for all of your favorite Elixir libraries
I have been put...
New
Hey guyz
We at @aviabird are working on a payment library in elixir/phoenix. We are targeting March 2018 to add 56 Gateways to it.
Have...
New
Other popular topics
Hello everyone,
I try to use an Javascript Event Handler in my root.html.leex file.
Therefore I created a function in the app.js file: ...
New
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
Phoenix 1.4.0 released
Phoenix 1.4 is out! This release ships with exciting new features, most notably
with HTTP2 support, improved deve...
New
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
New
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
I tried installing
elixir 1.11.2
erlang 23.3.4
via asdf in my zsh shell. Enabled the versions locally and globally.
When I list them ...
New
Got a question about when to concat vs. prepending items to list then reversing to achieve appending.
So i know lists boil down to [1 | ...
New
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!)
This post collects co...
New
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








