Thursday, May 15, 2014

Elasticsearch.Net and contributing to Open Source

So often as developers do we sit down and go “I can do this better”, then File –> New. With so many awesome open source projects, shouldn’t we be doing a “git clone” instead and submitting pull requests?

I have been guilty of this forever, and I think most windows developers have.

Last week I blogged about not being happy with how the Elasticsearch .Net clients work. I was all amped up to create my own client, and sit in a dark room during TechEd and just get it hammered out. I spent the first two nights in Houston working on a new HttpClient based Elasticsearch client with all the plans of being awesome.

Then Martijn Laarman, the creator of the Elasticsearch.Net and NEST libraries, reached out to me and very very kindly reminded me how stupid I was being.

First of all, I was wrong in my last post. Deep under the hood in the default HttpMessageHandler for HttpClient it uses HttpWebRequest and HttpWebResponse. The benefits of the HttpClient however is that the internals are swappable and it has a nice clean Async API. For example, CurlSharp is a new HttpMessageHandler using the libcurl library.

Martijn also suggested that instead of creating a new library, implement the Elasticsearch.Net.Connection.HttpClient in the main project and help make the project better.

With all that being said, AsyncElastic is gone, I deleted the repository, because I don’t want to roll my own, not only is it generally about 5,000% more work than you originally estimate, I legitimately don’t have the time to run an open source project of this scale.

I am happy to say that I have submitted pull requests to Elasticsearch.Net for the HttpClient implementation, and hope to in the future continue to submitting to this project to make it more robust and flexible.

I am unclear on the timelines, but I expect that the Elasticsearch.Net.Connection.HttpClient will be available on NuGet sometime in the future.

1 comment:

Tom Anderson said...

Update: This package is now available on Nuget.org.

http://www.nuget.org/packages/Elasticsearch.Net.Connection.HttpClient/