# Gateway plugin

**URL:** <https://discuss.elastic.co/t/gateway-plugin/2983>\
**Category:** Elasticsearch\
**Created:** [May 31, 2010, 6:02am UTC](https://discuss.elastic.co/t/gateway-plugin/2983 "2010-05-31T06:02:20Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sten\_Roger\_Sandvik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sten_roger_sandvik/32/2893_2.png) [@Sten\_Roger\_Sandvik](https://discuss.elastic.co/u/Sten_Roger_Sandvik)\
**Post date:** [May 31, 2010, 6:02am UTC](https://discuss.elastic.co/t/gateway-plugin/2983/1 "2010-05-31T06:02:20Z")

</div>

Hi.

I am trying to create a Gateway Plugin for Jdbc. Do I really need to  
have my plugin in the elasticsearch namespace?

BR,  
Sten Roger Sandvik

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 31, 2010, 11:54am UTC](https://discuss.elastic.co/t/gateway-plugin/2983/2 "2010-05-31T11:54:00Z")

</div>

No, you don't have to. I plan to work on simplifying the interface for  
pluggable ones. Also, blobs in database are a pain...

On Mon, May 31, 2010 at 9:02 AM, Sten Roger [stenrs@gmail.com](mailto:stenrs@gmail.com) wrote:

> Hi.
> 
> I am trying to create a Gateway Plugin for Jdbc. Do I really need to  
> have my plugin in the elasticsearch namespace?
> 
> BR,  
> Sten Roger Sandvik

---

<div class="post-metadata">

**Author:** ![Sten\_Roger\_Sandvik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sten_roger_sandvik/32/2893_2.png) [@Sten\_Roger\_Sandvik](https://discuss.elastic.co/u/Sten_Roger_Sandvik)\
**Post date:** [May 31, 2010, 7:42pm UTC](https://discuss.elastic.co/t/gateway-plugin/2983/3 "2010-05-31T19:42:16Z")

</div>

2010/5/31 Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)

> No, you don't have to. I plan to work on simplifying the interface for  
> pluggable ones. Also, blobs in database are a pain...

I have problem to use a custom gateway type. As I understand it I need to  
create a Guice module and bind the gateway implementation in that module.  
Done this and uses the module by setting gateway.type =  
com.foo.JdbcGatewayModule. Using this I get an error on startup saying  
"Component [com.foo.JdbcGateway] does not start with prefix  
[org.elasticsearch]".

If I put this in org.elasticsearch namespace it works perfectly. How can I  
get around this problem?

BR,  
Sten Roger Sandvik

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 31, 2010, 8:11pm UTC](https://discuss.elastic.co/t/gateway-plugin/2983/4 "2010-05-31T20:11:05Z")

</div>

This error comes (I guess, since I don't have the code) from the JdbcGateway  
itself. If my guess is correct, you call, within its constructor, to  
"super(settings)". In the base class AbstractComponent, it tries to resolve  
the settings prefix that will be used to configure the component. If none  
are passed, it assumes that it should start with "org.elasticsearch". You  
should pass in the "super" call also the settings prefix (i.e., I guess, in  
your case, "com", or "com.foo").

-shay.banon

On Mon, May 31, 2010 at 10:42 PM, Sten Roger Sandvik [stenrs@gmail.com](mailto:stenrs@gmail.com)wrote:

> 2010/5/31 Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)
> 
> No, you don't have to. I plan to work on simplifying the interface for
> 
> > pluggable ones. Also, blobs in database are a pain...
> 
> I have problem to use a custom gateway type. As I understand it I need to  
> create a Guice module and bind the gateway implementation in that module.  
> Done this and uses the module by setting gateway.type =  
> com.foo.JdbcGatewayModule. Using this I get an error on startup saying  
> "Component [com.foo.JdbcGateway] does not start with prefix  
> [org.elasticsearch]".
> 
> If I put this in org.elasticsearch namespace it works perfectly. How can I  
> get around this problem?
> 
> BR,  
> Sten Roger Sandvik

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 31, 2010, 8:12pm UTC](https://discuss.elastic.co/t/gateway-plugin/2983/5 "2010-05-31T20:12:09Z")

</div>

Another point. The gateway API are subject to change. I will be happy to  
help you migrate to newer versions, but I do plan to revisit the API and  
make it more easily pluggable, which might require changing custom gateways.

On Mon, May 31, 2010 at 11:11 PM, Shay Banon  
[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> This error comes (I guess, since I don't have the code) from the  
> JdbcGateway itself. If my guess is correct, you call, within its  
> constructor, to "super(settings)". In the base class AbstractComponent, it  
> tries to resolve the settings prefix that will be used to configure the  
> component. If none are passed, it assumes that it should start with  
> "org.elasticsearch". You should pass in the "super" call also the settings  
> prefix (i.e., I guess, in your case, "com", or "com.foo").
> 
> -shay.banon
> 
> On Mon, May 31, 2010 at 10:42 PM, Sten Roger Sandvik [stenrs@gmail.com](mailto:stenrs@gmail.com)wrote:
> 
> > 2010/5/31 Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)
> > 
> > No, you don't have to. I plan to work on simplifying the interface for
> > 
> > > pluggable ones. Also, blobs in database are a pain...
> > 
> > I have problem to use a custom gateway type. As I understand it I need to  
> > create a Guice module and bind the gateway implementation in that module.  
> > Done this and uses the module by setting gateway.type =  
> > com.foo.JdbcGatewayModule. Using this I get an error on startup saying  
> > "Component [com.foo.JdbcGateway] does not start with prefix  
> > [org.elasticsearch]".
> > 
> > If I put this in org.elasticsearch namespace it works perfectly. How can I  
> > get around this problem?
> > 
> > BR,  
> > Sten Roger Sandvik

---

<div class="post-metadata">

**Author:** ![Sten\_Roger\_Sandvik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sten_roger_sandvik/32/2893_2.png) [@Sten\_Roger\_Sandvik](https://discuss.elastic.co/u/Sten_Roger_Sandvik)\
**Post date:** [May 31, 2010, 8:36pm UTC](https://discuss.elastic.co/t/gateway-plugin/2983/6 "2010-05-31T20:36:05Z")

</div>

2010/5/31 Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)

> This error comes (I guess, since I don't have the code) from the  
> JdbcGateway itself. If my guess is correct, you call, within its  
> constructor, to "super(settings)". In the base class AbstractComponent, it  
> tries to resolve the settings prefix that will be used to configure the  
> component. If none are passed, it assumes that it should start with  
> "org.elasticsearch". You should pass in the "super" call also the settings  
> prefix (i.e., I guess, in your case, "com", or "com.foo").

Thanks for a really fast response. Yes, right on spot. I now send the  
settings prefix down to the super constructor and it worked perfectly. Will  
probably open source (or donate) this code when it's done - if nobody beats  
it to me that is 🙂

BR,  
Sten Roger Sandvik

---

<div class="post-metadata">

**Author:** ![Sten\_Roger\_Sandvik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sten_roger_sandvik/32/2893_2.png) [@Sten\_Roger\_Sandvik](https://discuss.elastic.co/u/Sten_Roger_Sandvik)\
**Post date:** [May 31, 2010, 8:36pm UTC](https://discuss.elastic.co/t/gateway-plugin/2983/7 "2010-05-31T20:36:50Z")

</div>

2010/5/31 Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)

> Another point. The gateway API are subject to change. I will be happy to  
> help you migrate to newer versions, but I do plan to revisit the API and  
> make it more easily pluggable, which might require changing custom gateways.

Ah, nice to know. Looking forward to it.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 31, 2010, 9:09pm UTC](https://discuss.elastic.co/t/gateway-plugin/2983/8 "2010-05-31T21:09:12Z")

</div>

Would be happy to get this is a plugin into elasticsearch, though I have  
been burnt with blobs and jdbc in Compass .... . One thing to note is that  
files stored should probably not be stored as a single blob, but broken down  
into chunks... .

On Mon, May 31, 2010 at 11:36 PM, Sten Roger Sandvik [stenrs@gmail.com](mailto:stenrs@gmail.com)wrote:

> 2010/5/31 Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)
> 
> > This error comes (I guess, since I don't have the code) from the  
> > JdbcGateway itself. If my guess is correct, you call, within its  
> > constructor, to "super(settings)". In the base class AbstractComponent, it  
> > tries to resolve the settings prefix that will be used to configure the  
> > component. If none are passed, it assumes that it should start with  
> > "org.elasticsearch". You should pass in the "super" call also the settings  
> > prefix (i.e., I guess, in your case, "com", or "com.foo").
> 
> Thanks for a really fast response. Yes, right on spot. I now send the  
> settings prefix down to the super constructor and it worked perfectly. Will  
> probably open source (or donate) this code when it's done - if nobody beats  
> it to me that is 🙂
> 
> BR,  
> Sten Roger Sandvik

---

<div class="post-metadata">

**Author:** ![Sten\_Roger\_Sandvik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sten_roger_sandvik/32/2893_2.png) [@Sten\_Roger\_Sandvik](https://discuss.elastic.co/u/Sten_Roger_Sandvik)\
**Post date:** [June 1, 2010, 5:11am UTC](https://discuss.elastic.co/t/gateway-plugin/2983/9 "2010-06-01T05:11:47Z")

</div>

2010/5/31 Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)

> Would be happy to get this is a plugin into elasticsearch, though I have  
> been burnt with blobs and jdbc in Compass .... . One thing to note is that  
> files stored should probably not be stored as a single blob, but broken down  
> into chunks... .

Yes. I have struggled with blobs myself. But, when broken down into chunks  
(as you say) it's doable. Will be happy to donate this when it's finished  
and working properly.

---

<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, 4:23am UTC](https://discuss.elastic.co/t/gateway-plugin/2983/10 "2017-07-06T04:23:41Z")

</div>


