# Where to drop jar containing custome plugin or encoder like custom Kafka message decoder

**URL:** <https://discuss.elastic.co/t/where-to-drop-jar-containing-custome-plugin-or-encoder-like-custom-kafka-message-decoder/39190>\
**Category:** Logstash\
**Created:** [January 14, 2016, 5:39am UTC](https://discuss.elastic.co/t/where-to-drop-jar-containing-custome-plugin-or-encoder-like-custom-kafka-message-decoder/39190 "2016-01-14T05:39:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![anandnsingh](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@anandnsingh](https://discuss.elastic.co/u/anandnsingh)\
**Post date:** [January 14, 2016, 5:39am UTC](https://discuss.elastic.co/t/where-to-drop-jar-containing-custome-plugin-or-encoder-like-custom-kafka-message-decoder/39190/1 "2016-01-14T05:39:59Z")

</div>

How to use custom decoder. What is the right location of a jar file containing this custom decoder. I

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 14, 2016, 6:16am UTC](https://discuss.elastic.co/t/where-to-drop-jar-containing-custome-plugin-or-encoder-like-custom-kafka-message-decoder/39190/2 "2016-01-14T06:16:57Z")

</div>

You mean codec?

---

<div class="post-metadata">

**Author:** ![anandnsingh](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@anandnsingh](https://discuss.elastic.co/u/anandnsingh)\
**Post date:** [January 14, 2016, 4:25pm UTC](https://discuss.elastic.co/t/where-to-drop-jar-containing-custome-plugin-or-encoder-like-custom-kafka-message-decoder/39190/3 "2016-01-14T16:25:59Z")

</div>

Not codec. I meant decoder\_class . According to the document the default value is kafka.serializer.DefaultDecoder . I replaced it with a custom java class and tried dropping the jar file containing this class at different locations in my logstash home directory. It fail to find the class. ( logstash version - 2.1.1).

---

<div class="post-metadata">

**Author:** ![Joe\_Lawson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_lawson/32/3390_2.png) [@Joe\_Lawson](https://discuss.elastic.co/u/Joe_Lawson)\
**Post date:** [January 15, 2016, 12:59pm UTC](https://discuss.elastic.co/t/where-to-drop-jar-containing-custome-plugin-or-encoder-like-custom-kafka-message-decoder/39190/4 "2016-01-15T12:59:03Z")

</div>

I don't think we ever nailed this down for the feature. You can find the  
Kafka jar and drop it in that directory. Not ideal but it should work...

---

<div class="post-metadata">

**Author:** ![anandnsingh](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@anandnsingh](https://discuss.elastic.co/u/anandnsingh)\
**Post date:** [January 15, 2016, 6:10pm UTC](https://discuss.elastic.co/t/where-to-drop-jar-containing-custome-plugin-or-encoder-like-custom-kafka-message-decoder/39190/5 "2016-01-15T18:10:17Z")

</div>

Thanks Joe for the reply. I had tried this - adding this in kafka\_2.10-0.8.2.1.jar . Got the following error  
_Couldn't find any input plugin named 'kafka'. Are you sure this is correct? Trying to load the kafka input plugin resulted in this error: cannot load Java class kafka.consumer.ConsumerIterator_

I verified the missing file the above error mentions and related files are there in the repackaged jars.  
My logstash version is 2.1.1. and java env is 1.8.0\_31. Can the java version be an issue in case this and other original jar files in the distribution were compiled and archived in java 1.7.x environment? Any other reason ?

---

<div class="post-metadata">

**Author:** ![anandnsingh](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@anandnsingh](https://discuss.elastic.co/u/anandnsingh)\
**Post date:** [January 23, 2016, 7:59pm UTC](https://discuss.elastic.co/t/where-to-drop-jar-containing-custome-plugin-or-encoder-like-custom-kafka-message-decoder/39190/6 "2016-01-23T19:59:51Z")

</div>

I found an easy solution .  
Its applicable to i) logtash 2.1 & ii) if you have maven build system.  
Adding maven coordinates (groupId, artifactId and version) as it appears in local maven repository's pom file for all my jar dependencies in "./vendor/bundle/jruby/1.9/gems/jruby-kafka-1.4.0-java/lib/jruby-kafka\_jars.rb" did the trick.

---

<div class="post-metadata">

**Author:** ![Joe\_Lawson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_lawson/32/3390_2.png) [@Joe\_Lawson](https://discuss.elastic.co/u/Joe_Lawson)\
**Post date:** [February 21, 2016, 8:27pm UTC](https://discuss.elastic.co/t/where-to-drop-jar-containing-custome-plugin-or-encoder-like-custom-kafka-message-decoder/39190/7 "2016-02-21T20:27:49Z")

</div>

Thanks for the tip!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 5:10am UTC](https://discuss.elastic.co/t/where-to-drop-jar-containing-custome-plugin-or-encoder-like-custom-kafka-message-decoder/39190/8 "2017-07-06T05:10:22Z")

</div>


