# Can I use the java client of newer version to connect to a old version server?

**URL:** <https://discuss.elastic.co/t/can-i-use-the-java-client-of-newer-version-to-connect-to-a-old-version-server/18475>\
**Category:** Elasticsearch\
**Created:** [July 4, 2014, 5:09am UTC](https://discuss.elastic.co/t/can-i-use-the-java-client-of-newer-version-to-connect-to-a-old-version-server/18475 "2014-07-04T05:09:33Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![xzer\_LR](https://avatars.discourse-cdn.com/v4/letter/x/2acd7d/32.png) [@xzer\_LR](https://discuss.elastic.co/u/xzer_LR)\
**Post date:** [July 4, 2014, 5:09am UTC](https://discuss.elastic.co/t/can-i-use-the-java-client-of-newer-version-to-connect-to-a-old-version-server/18475/1 "2014-07-04T05:09:33Z")

</div>

For some reasons, we have several separated elasticsearch clusters for our  
front applicaitons. We want to upgrade our clusters' version to the newest  
version but apparently it is impossible to upgrade all the clusters at the  
same time, which means our single application have to connect to multiple  
clusters with different versions.

My question is whether the elasticsearch java client has the ability to  
work correctly with an old version server?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 4, 2014, 6:30am UTC](https://discuss.elastic.co/t/can-i-use-the-java-client-of-newer-version-to-connect-to-a-old-version-server/18475/2 "2014-07-04T06:30:01Z")

</div>

Well. It depends.

1.0 is incompatible with 0.90  
1.2 should work with 1.x IIRC.

From 1.0, we try to keep this compatible. If not, release notes will tell you.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 4 juil. 2014 à 07:09, xzer LR [xiaozhu@gmail.com](mailto:xiaozhu@gmail.com) a écrit :

For some reasons, we have several separated elasticsearch clusters for our front applicaitons. We want to upgrade our clusters' version to the newest version but apparently it is impossible to upgrade all the clusters at the same time, which means our single application have to connect to multiple clusters with different versions.

## My question is whether the elasticsearch java client has the ability to work correctly with an old version server?

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/97C66A72-7C01-4059-9DCE-F6B568FEB7E1%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/97C66A72-7C01-4059-9DCE-F6B568FEB7E1%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![xzer\_LR](https://avatars.discourse-cdn.com/v4/letter/x/2acd7d/32.png) [@xzer\_LR](https://discuss.elastic.co/u/xzer_LR)\
**Post date:** [July 11, 2014, 9:14am UTC](https://discuss.elastic.co/t/can-i-use-the-java-client-of-newer-version-to-connect-to-a-old-version-server/18475/3 "2014-07-11T09:14:55Z")

</div>

As a test result, I got exceptions when I tried to use the newest 1.2.2  
java client to connect to a 1.0.3 cluster:

18:05:41.020 [elasticsearch[Slipstream][transport\_client\_worker][T#1]{New  
I/O worker #1}] [INFO] org.elasticsearch.client.transport[105] -  
[Slipstream] failed to get local cluster state for  
[#transport#-1][e-note][inet[/192.168.200.81:9300]], disconnecting...  
org.elasticsearch.transport.RemoteTransportException:  
[server-cat][inet[/192.168.21.81:9300]][cluster/state]  
java.lang.IndexOutOfBoundsException: Readable byte limit exceeded: 48  
at  
org.elasticsearch.common.netty.buffer.AbstractChannelBuffer.readByte(AbstractChannelBuffer.java:236)  
~[elasticsearch-1.2.2.jar:na]  
at  
org.elasticsearch.transport.netty.ChannelBufferStreamInput.readByte(ChannelBufferStreamInput.java:132)  
~[elasticsearch-1.2.2.jar:na]  
at  
org.elasticsearch.common.io.stream.StreamInput.readVInt(StreamInput.java:141)  
~[elasticsearch-1.2.2.jar:na]  
at  
org.elasticsearch.common.io.stream.StreamInput.readString(StreamInput.java:272)  
~[elasticsearch-1.2.2.jar:na]  
at  
org.elasticsearch.common.io.stream.HandlesStreamInput.readString(HandlesStreamInput.java:61)  
~[elasticsearch-1.2.2.jar:na]  
at  
org.elasticsearch.common.io.stream.StreamInput.readStringArray(StreamInput.java:362)  
~[elasticsearch-1.2.2.jar:na]  
at  
org.elasticsearch.action.admin.cluster.state.ClusterStateRequest.readFrom(ClusterStateRequest.java:132)  
~[elasticsearch-1.2.2.jar:na]  
at  
org.elasticsearch.transport.netty.MessageChannelHandler.handleRequest(MessageChannelHandler.java:209)  
~[elasticsearch-1.2.2.jar:na]  
at  
org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:109)  
~[elasticsearch-1.2.2.jar:na]

I didn't find any metioned break change about this exceptioin.

在 2014年7月4日星期五UTC+9下午3时31分07秒，David Pilato写道：

> Well. It depends.
> 
> 1.0 is incompatible with 0.90  
> 1.2 should work with 1.x IIRC.
> 
> From 1.0, we try to keep this compatible. If not, release notes will tell  
> you.
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 4 juil. 2014 à 07:09, xzer LR \<[xia...@gmail.com](mailto:xia...@gmail.com) \<javascript:\>\> a  
> écrit :
> 
> For some reasons, we have several separated elasticsearch clusters for our  
> front applicaitons. We want to upgrade our clusters' version to the newest  
> version but apparently it is impossible to upgrade all the clusters at the  
> same time, which means our single application have to connect to multiple  
> clusters with different versions.
> 
> My question is whether the elasticsearch java client has the ability to  
> work correctly with an old version server?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 11, 2014, 9:51am UTC](https://discuss.elastic.co/t/can-i-use-the-java-client-of-newer-version-to-connect-to-a-old-version-server/18475/4 "2014-07-11T09:51:11Z")

</div>

Are you using a TransportClient or NodeClient?  
If NodeClient, could you try with the TransportClient?

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 11 juillet 2014 à 11:14:59, xzer LR ([xiaozhu@gmail.com](mailto:xiaozhu@gmail.com)) a écrit:

As a test result, I got exceptions when I tried to use the newest 1.2.2 java client to connect to a 1.0.3 cluster:

18:05:41.020 [elasticsearch[Slipstream][transport\_client\_worker][T#1]{New I/O worker #1}] [INFO] [] org.elasticsearch.client.transport[105] - [Slipstream] failed to get local cluster state for [#transport#-1][e-note][inet[/192.168.200.81:9300]], disconnecting...  
org.elasticsearch.transport.RemoteTransportException: [server-cat][inet[/192.168.21.81:9300]][cluster/state]  
java.lang.IndexOutOfBoundsException: Readable byte limit exceeded: 48  
at org.elasticsearch.common.netty.buffer.AbstractChannelBuffer.readByte(AbstractChannelBuffer.java:236) ~[elasticsearch-1.2.2.jar:na]  
at org.elasticsearch.transport.netty.ChannelBufferStreamInput.readByte(ChannelBufferStreamInput.java:132) ~[elasticsearch-1.2.2.jar:na]  
at org.elasticsearch.common.io.stream.StreamInput.readVInt(StreamInput.java:141) ~[elasticsearch-1.2.2.jar:na]  
at org.elasticsearch.common.io.stream.StreamInput.readString(StreamInput.java:272) ~[elasticsearch-1.2.2.jar:na]  
at org.elasticsearch.common.io.stream.HandlesStreamInput.readString(HandlesStreamInput.java:61) ~[elasticsearch-1.2.2.jar:na]  
at org.elasticsearch.common.io.stream.StreamInput.readStringArray(StreamInput.java:362) ~[elasticsearch-1.2.2.jar:na]  
at org.elasticsearch.action.admin.cluster.state.ClusterStateRequest.readFrom(ClusterStateRequest.java:132) ~[elasticsearch-1.2.2.jar:na]  
at org.elasticsearch.transport.netty.MessageChannelHandler.handleRequest(MessageChannelHandler.java:209) ~[elasticsearch-1.2.2.jar:na]  
at org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:109) ~[elasticsearch-1.2.2.jar:na]

I didn't find any metioned break change about this exceptioin.

在 2014年7月4日星期五UTC+9下午3时31分07秒，David Pilato写道：  
Well. It depends.

1.0 is incompatible with 0.90  
1.2 should work with 1.x IIRC.

From 1.0, we try to keep this compatible. If not, release notes will tell you.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 4 juil. 2014 à 07:09, xzer LR [xia...@gmail.com](mailto:xia...@gmail.com) a écrit :

For some reasons, we have several separated elasticsearch clusters for our front applicaitons. We want to upgrade our clusters' version to the newest version but apparently it is impossible to upgrade all the clusters at the same time, which means our single application have to connect to multiple clusters with different versions.

## My question is whether the elasticsearch java client has the ability to work correctly with an old version server?

## You received this message because you are subscribed to the Google Groups "elasticsearch" group. To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com). To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com). For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/etPan.53bfb38f.1190cde7.70e%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.53bfb38f.1190cde7.70e%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![xzer\_LR](https://avatars.discourse-cdn.com/v4/letter/x/2acd7d/32.png) [@xzer\_LR](https://discuss.elastic.co/u/xzer_LR)\
**Post date:** [July 11, 2014, 10:30am UTC](https://discuss.elastic.co/t/can-i-use-the-java-client-of-newer-version-to-connect-to-a-old-version-server/18475/5 "2014-07-11T10:30:28Z")

</div>

I am using TransportClient, the following is how I retrieve the client  
instance:

Client client = new  
TransportClient(sb.build()).addTransportAddresses(esAddresses);

在 2014年7月11日星期五UTC+9下午6时51分26秒，David Pilato写道：

> Are you using a TransportClient or NodeClient?  
> If NodeClient, could you try with the TransportClient?
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 11 juillet 2014 à 11:14:59, xzer LR ([xia...@gmail.com](mailto:xia...@gmail.com) \<javascript:\>) a  
> écrit:
> 
> As a test result, I got exceptions when I tried to use the newest 1.2.2  
> java client to connect to a 1.0.3 cluster:
> 
> 18:05:41.020  
> [elasticsearch[Slipstream][transport\_client\_worker][T#1]{New I/O worker  
> #1}] [INFO] org.elasticsearch.client.transport[105] - [Slipstream]  
> failed to get local cluster state for  
> [#transport#-1][e-note][inet[/192.168.200.81:9300]], disconnecting...  
> org.elasticsearch.transport.RemoteTransportException:  
> [server-cat][inet[/192.168.21.81:9300]][cluster/state]  
> java.lang.IndexOutOfBoundsException: Readable byte limit exceeded: 48  
> at  
> org.elasticsearch.common.netty.buffer.AbstractChannelBuffer.readByte(AbstractChannelBuffer.java:236)  
> ~[elasticsearch-1.2.2.jar:na]  
> at  
> org.elasticsearch.transport.netty.ChannelBufferStreamInput.readByte(ChannelBufferStreamInput.java:132)  
> ~[elasticsearch-1.2.2.jar:na]  
> at  
> org.elasticsearch.common.io.stream.StreamInput.readVInt(StreamInput.java:141)  
> ~[elasticsearch-1.2.2.jar:na]  
> at  
> org.elasticsearch.common.io.stream.StreamInput.readString(StreamInput.java:272)  
> ~[elasticsearch-1.2.2.jar:na]  
> at  
> org.elasticsearch.common.io.stream.HandlesStreamInput.readString(HandlesStreamInput.java:61)  
> ~[elasticsearch-1.2.2.jar:na]  
> at  
> org.elasticsearch.common.io.stream.StreamInput.readStringArray(StreamInput.java:362)  
> ~[elasticsearch-1.2.2.jar:na]  
> at  
> org.elasticsearch.action.admin.cluster.state.ClusterStateRequest.readFrom(ClusterStateRequest.java:132)  
> ~[elasticsearch-1.2.2.jar:na]  
> at  
> org.elasticsearch.transport.netty.MessageChannelHandler.handleRequest(MessageChannelHandler.java:209)  
> ~[elasticsearch-1.2.2.jar:na]  
> at  
> org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:109)  
> ~[elasticsearch-1.2.2.jar:na]
> 
> I didn't find any metioned break change about this exceptioin.
> 
> 在 2014年7月4日星期五UTC+9下午3时31分07秒，David Pilato写道：
> 
> > Well. It depends.
> > 
> > 1.0 is incompatible with 0.90  
> > 1.2 should work with 1.x IIRC.
> > 
> > From 1.0, we try to keep this compatible. If not, release notes will tell  
> > you.
> > 
> > --  
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > Le 4 juil. 2014 à 07:09, xzer LR [xia...@gmail.com](mailto:xia...@gmail.com) a écrit :
> > 
> > For some reasons, we have several separated elasticsearch clusters for  
> > our front applicaitons. We want to upgrade our clusters' version to the  
> > newest version but apparently it is impossible to upgrade all the clusters  
> > at the same time, which means our single application have to connect to  
> > multiple clusters with different versions.
> > 
> > ## My question is whether the elasticsearch java client has the ability to work correctly with an old version server?
> > 
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/df3afd7e-b0a5-4d26-a777-fc887427bbed%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/df3afd7e-b0a5-4d26-a777-fc887427bbed%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [July 11, 2014, 7:28pm UTC](https://discuss.elastic.co/t/can-i-use-the-java-client-of-newer-version-to-connect-to-a-old-version-server/18475/6 "2014-07-11T19:28:54Z")

</div>

The code is suspicious since it has an explicit check for versions prior to  
1.2

[https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequest.java#L121-L124](https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequest.java#L121-L124)

Don't know much else about the code to comment further.

Cheers,

Ivan

On Fri, Jul 11, 2014 at 3:30 AM, xzer LR [xiaozhu@gmail.com](mailto:xiaozhu@gmail.com) wrote:

> I am using TransportClient, the following is how I retrieve the client  
> instance:
> 
> Client client = new  
> TransportClient(sb.build()).addTransportAddresses(esAddresses);
> 
> 在 2014年7月11日星期五UTC+9下午6时51分26秒，David Pilato写道：
> 
> > Are you using a TransportClient or NodeClient?  
> > If NodeClient, could you try with the TransportClient?
> > 
> > --  
> > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> > [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> > 
> > Le 11 juillet 2014 à 11:14:59, xzer LR ([xia...@gmail.com](mailto:xia...@gmail.com)) a écrit:
> > 
> > As a test result, I got exceptions when I tried to use the newest 1.2.2  
> > java client to connect to a 1.0.3 cluster:
> > 
> > 18:05:41.020 [elasticsearch[Slipstream][transport\_client\_worker][T#1]{New  
> > I/O worker #1}] [INFO] org.elasticsearch.client.transport[105] -  
> > [Slipstream] failed to get local cluster state for  
> > [#transport#-1][e-note][inet[/192.168.200.81:9300]], disconnecting...  
> > org.elasticsearch.transport.RemoteTransportException: [server-cat][inet[/  
> > 192.168.21.81:9300]][cluster/state]  
> > java.lang.IndexOutOfBoundsException: Readable byte limit exceeded: 48  
> > at org.elasticsearch.common.netty.buffer.AbstractChannelBuffer.readByte(  
> > AbstractChannelBuffer.java:236) ~[elasticsearch-1.2.2.jar:na]  
> > at org.elasticsearch.transport.netty.ChannelBufferStreamInput.readByte(  
> > ChannelBufferStreamInput.java:132) ~[elasticsearch-1.2.2.jar:na]  
> > at org.elasticsearch.common.io.stream.StreamInput.readVInt(StreamInput.java:141)  
> > ~[elasticsearch-1.2.2.jar:na]  
> > at org.elasticsearch.common.io.stream.StreamInput.readString(StreamInput.java:272)  
> > ~[elasticsearch-1.2.2.jar:na]  
> > at org.elasticsearch.common.io.stream.HandlesStreamInput.  
> > readString(HandlesStreamInput.java:61) ~[elasticsearch-1.2.2.jar:na]  
> > at org.elasticsearch.common.io.stream.StreamInput.  
> > readStringArray(StreamInput.java:362) ~[elasticsearch-1.2.2.jar:na]  
> > at org.elasticsearch.action.admin.cluster.state.  
> > ClusterStateRequest.readFrom(ClusterStateRequest.java:132)  
> > ~[elasticsearch-1.2.2.jar:na]  
> > at org.elasticsearch.transport.netty.MessageChannelHandler.handleRequest(  
> > MessageChannelHandler.java:209) ~[elasticsearch-1.2.2.jar:na]  
> > at org.elasticsearch.transport.netty.MessageChannelHandler.  
> > messageReceived(MessageChannelHandler.java:109)  
> > ~[elasticsearch-1.2.2.jar:na]
> > 
> > I didn't find any metioned break change about this exceptioin.
> > 
> > 在 2014年7月4日星期五UTC+9下午3时31分07秒，David Pilato写道：
> > 
> > > Well. It depends.
> > > 
> > > 1.0 is incompatible with 0.90  
> > > 1.2 should work with 1.x IIRC.
> > > 
> > > From 1.0, we try to keep this compatible. If not, release notes will  
> > > tell you.
> > > 
> > > --  
> > > David 😉  
> > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > 
> > > Le 4 juil. 2014 à 07:09, xzer LR [xia...@gmail.com](mailto:xia...@gmail.com) a écrit :
> > > 
> > > For some reasons, we have several separated elasticsearch clusters for  
> > > our front applicaitons. We want to upgrade our clusters' version to the  
> > > newest version but apparently it is impossible to upgrade all the clusters  
> > > at the same time, which means our single application have to connect to  
> > > multiple clusters with different versions.
> > > 
> > > ## My question is whether the elasticsearch java client has the ability to work correctly with an old version server?
> > > 
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%  
> > > [40googlegroups.com](http://40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%  
> > [40googlegroups.com](http://40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/df3afd7e-b0a5-4d26-a777-fc887427bbed%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/df3afd7e-b0a5-4d26-a777-fc887427bbed%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/df3afd7e-b0a5-4d26-a777-fc887427bbed%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/df3afd7e-b0a5-4d26-a777-fc887427bbed%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBCBTqfnetUsksf47M\_QwtAjtSrRNVHsj-VN6%3DJb862Vw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBCBTqfnetUsksf47M_QwtAjtSrRNVHsj-VN6%3DJb862Vw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![xzer\_LR](https://avatars.discourse-cdn.com/v4/letter/x/2acd7d/32.png) [@xzer\_LR](https://discuss.elastic.co/u/xzer_LR)\
**Post date:** [July 14, 2014, 8:36am UTC](https://discuss.elastic.co/t/can-i-use-the-java-client-of-newer-version-to-connect-to-a-old-version-server/18475/7 "2014-07-14T08:36:27Z")

</div>

I think I got the reason.

At first, I noticed that the row number from the exception stack is not  
compatible to the client 1.2.2 source, then it exactly occurred at the old  
version 1.0.3 server side.

Then the service side exception told us that it failed from reading the  
last string array:

> <https://github.com/elastic/elasticsearch/blob/1.0/src/main/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequest.java#L132>

I recognized that the real problem is the client size did not check the  
version correctly, then I digged the source more deeply, then I found the  
following row which seems wrong:

> <https://github.com/elastic/elasticsearch/blob/1.0/src/main/java/org/elasticsearch/client/transport/TransportClientNodesService.java#L164>

DiscoveryNode node = new DiscoveryNode("#transport#-" + tempNodeIdGenerator  
.incrementAndGet(), transportAddress, version);

_The nodes passed to construct the transport client are simply initialized  
as the current client version._

I have no idea how to fix it but it seems that it should be reported as a  
bug?

在 2014年7月12日星期六UTC+9上午4时29分01秒，Ivan Brusic写道：

> The code is suspicious since it has an explicit check for versions prior  
> to 1.2
> 
> [https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequest.java#L121-L124](https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequest.java#L121-L124)
> 
> Don't know much else about the code to comment further.
> 
> Cheers,
> 
> Ivan
> 
> On Fri, Jul 11, 2014 at 3:30 AM, xzer LR \<[xia...@gmail.com](mailto:xia...@gmail.com) \<javascript:\>\>  
> wrote:
> 
> > I am using TransportClient, the following is how I retrieve the client  
> > instance:
> > 
> > Client client = new  
> > TransportClient(sb.build()).addTransportAddresses(esAddresses);
> > 
> > 在 2014年7月11日星期五UTC+9下午6时51分26秒，David Pilato写道：
> > 
> > > Are you using a TransportClient or NodeClient?  
> > > If NodeClient, could you try with the TransportClient?
> > > 
> > > --  
> > > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> > > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> > > [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> > > 
> > > Le 11 juillet 2014 à 11:14:59, xzer LR ([xia...@gmail.com](mailto:xia...@gmail.com)) a écrit:
> > > 
> > > As a test result, I got exceptions when I tried to use the newest  
> > > 1.2.2 java client to connect to a 1.0.3 cluster:
> > > 
> > > 18:05:41.020 [elasticsearch[Slipstream][transport\_client\_worker][T#1]{New  
> > > I/O worker #1}] [INFO] org.elasticsearch.client.transport[105] -  
> > > [Slipstream] failed to get local cluster state for  
> > > [#transport#-1][e-note][inet[/192.168.200.81:9300]], disconnecting...  
> > > org.elasticsearch.transport.RemoteTransportException:  
> > > [server-cat][inet[/192.168.21.81:9300]][cluster/state]  
> > > java.lang.IndexOutOfBoundsException: Readable byte limit exceeded: 48  
> > > at org.elasticsearch.common.netty.buffer.AbstractChannelBuffer.readByte(  
> > > AbstractChannelBuffer.java:236) ~[elasticsearch-1.2.2.jar:na]  
> > > at org.elasticsearch.transport.netty.ChannelBufferStreamInput.readByte(  
> > > ChannelBufferStreamInput.java:132) ~[elasticsearch-1.2.2.jar:na]  
> > > at org.elasticsearch.common.io.stream.StreamInput.readVInt(StreamInput.java:141)  
> > > ~[elasticsearch-1.2.2.jar:na]  
> > > at org.elasticsearch.common.io.stream.StreamInput.readString(StreamInput.java:272)  
> > > ~[elasticsearch-1.2.2.jar:na]  
> > > at org.elasticsearch.common.io.stream.HandlesStreamInput.  
> > > readString(HandlesStreamInput.java:61) ~[elasticsearch-1.2.2.jar:na]  
> > > at org.elasticsearch.common.io.stream.StreamInput.  
> > > readStringArray(StreamInput.java:362) ~[elasticsearch-1.2.2.jar:na]  
> > > at org.elasticsearch.action.admin.cluster.state.  
> > > ClusterStateRequest.readFrom(ClusterStateRequest.java:132)  
> > > ~[elasticsearch-1.2.2.jar:na]  
> > > at org.elasticsearch.transport.netty.MessageChannelHandler.  
> > > handleRequest(MessageChannelHandler.java:209)  
> > > ~[elasticsearch-1.2.2.jar:na]  
> > > at org.elasticsearch.transport.netty.MessageChannelHandler.  
> > > messageReceived(MessageChannelHandler.java:109)  
> > > ~[elasticsearch-1.2.2.jar:na]
> > > 
> > > I didn't find any metioned break change about this exceptioin.
> > > 
> > > 在 2014年7月4日星期五UTC+9下午3时31分07秒，David Pilato写道：
> > > 
> > > > Well. It depends.
> > > > 
> > > > 1.0 is incompatible with 0.90  
> > > > 1.2 should work with 1.x IIRC.
> > > > 
> > > > From 1.0, we try to keep this compatible. If not, release notes will  
> > > > tell you.
> > > > 
> > > > --  
> > > > David 😉  
> > > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > > 
> > > > Le 4 juil. 2014 à 07:09, xzer LR [xia...@gmail.com](mailto:xia...@gmail.com) a écrit :
> > > > 
> > > > For some reasons, we have several separated elasticsearch clusters  
> > > > for our front applicaitons. We want to upgrade our clusters' version to the  
> > > > newest version but apparently it is impossible to upgrade all the clusters  
> > > > at the same time, which means our single application have to connect to  
> > > > multiple clusters with different versions.
> > > > 
> > > > ## My question is whether the elasticsearch java client has the ability to work correctly with an old version server?
> > > > 
> > > > You received this message because you are subscribed to the Google  
> > > > Groups "elasticsearch" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%  
> > > > [40googlegroups.com](http://40googlegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .  
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%  
> > > [40googlegroups.com](http://40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google Groups  
> > > "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/df3afd7e-b0a5-4d26-a777-fc887427bbed%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/df3afd7e-b0a5-4d26-a777-fc887427bbed%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/df3afd7e-b0a5-4d26-a777-fc887427bbed%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/df3afd7e-b0a5-4d26-a777-fc887427bbed%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/86ad8e40-fae6-4581-9972-4c68a0db9d37%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/86ad8e40-fae6-4581-9972-4c68a0db9d37%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [July 14, 2014, 9:35am UTC](https://discuss.elastic.co/t/can-i-use-the-java-client-of-newer-version-to-connect-to-a-old-version-server/18475/8 "2014-07-14T09:35:52Z")

</div>

You can not connect a newer TransportClient to a server which is older. You  
can connect an older TransportClient to a newer server (without being able  
to use new features).

Jörg

On Mon, Jul 14, 2014 at 10:36 AM, xzer LR [xiaozhu@gmail.com](mailto:xiaozhu@gmail.com) wrote:

> I think I got the reason.
> 
> At first, I noticed that the row number from the exception stack is not  
> compatible to the client 1.2.2 source, then it exactly occurred at the old  
> version 1.0.3 server side.
> 
> Then the service side exception told us that it failed from reading the  
> last string array:
> 
> [https://github.com/elasticsearch/elasticsearch/blob/1.0/src/main/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequest.java#L132](https://github.com/elasticsearch/elasticsearch/blob/1.0/src/main/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequest.java#L132)
> 
> I recognized that the real problem is the client size did not check the  
> version correctly, then I digged the source more deeply, then I found the  
> following row which seems wrong:
> 
> [https://github.com/elasticsearch/elasticsearch/blob/1.0/src/main/java/org/elasticsearch/client/transport/TransportClientNodesService.java#L164](https://github.com/elasticsearch/elasticsearch/blob/1.0/src/main/java/org/elasticsearch/client/transport/TransportClientNodesService.java#L164)
> 
> DiscoveryNode node = new DiscoveryNode("#transport#-" +  
> tempNodeIdGenerator.incrementAndGet(), transportAddress, version);
> 
> _The nodes passed to construct the transport client are simply initialized  
> as the current client version._
> 
> I have no idea how to fix it but it seems that it should be reported as a  
> bug?
> 
> 在 2014年7月12日星期六UTC+9上午4时29分01秒，Ivan Brusic写道：
> 
> > The code is suspicious since it has an explicit check for versions prior  
> > to 1.2
> > 
> > [GitHub - elastic/elasticsearch: Free and Open, Distributed, RESTful Search Engine](https://github.com/elasticsearch/elasticsearch/)  
> > blob/master/src/main/java/org/elasticsearch/action/admin/cluster/state/  
> > ClusterStateRequest.java#L121-L124
> > 
> > Don't know much else about the code to comment further.
> > 
> > Cheers,
> > 
> > Ivan
> > 
> > On Fri, Jul 11, 2014 at 3:30 AM, xzer LR [xia...@gmail.com](mailto:xia...@gmail.com) wrote:
> > 
> > > I am using TransportClient, the following is how I retrieve the client  
> > > instance:
> > > 
> > > Client client = new TransportClient(sb.build()).addTransportAddresses(  
> > > esAddresses);
> > > 
> > > 在 2014年7月11日星期五UTC+9下午6时51分26秒，David Pilato写道：
> > > 
> > > > Are you using a TransportClient or NodeClient?  
> > > > If NodeClient, could you try with the TransportClient?
> > > > 
> > > > --  
> > > > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> > > > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> > > > [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> > > > 
> > > > Le 11 juillet 2014 à 11:14:59, xzer LR ([xia...@gmail.com](mailto:xia...@gmail.com)) a écrit:
> > > > 
> > > > As a test result, I got exceptions when I tried to use the newest  
> > > > 1.2.2 java client to connect to a 1.0.3 cluster:
> > > > 
> > > > 18:05:41.020 [elasticsearch[Slipstream][transport\_client\_worker][T#1]{New  
> > > > I/O worker #1}] [INFO] org.elasticsearch.client.transport[105] -  
> > > > [Slipstream] failed to get local cluster state for  
> > > > [#transport#-1][e-note][inet[/192.168.200.81:9300]], disconnecting...  
> > > > org.elasticsearch.transport.RemoteTransportException:  
> > > > [server-cat][inet[/192.168.21.81:9300]][cluster/state]  
> > > > java.lang.IndexOutOfBoundsException: Readable byte limit exceeded: 48  
> > > > at org.elasticsearch.common.netty.buffer.AbstractChannelBuffer.  
> > > > readByte(AbstractChannelBuffer.java:236) ~[elasticsearch-1.2.2.jar:na]  
> > > > at org.elasticsearch.transport.netty.ChannelBufferStreamInput.readByte(  
> > > > ChannelBufferStreamInput.java:132) ~[elasticsearch-1.2.2.jar:na]  
> > > > at org.elasticsearch.common.io.stream.StreamInput.readVInt(StreamInput.java:141)  
> > > > ~[elasticsearch-1.2.2.jar:na]  
> > > > at org.elasticsearch.common.io.stream.StreamInput.readString(StreamInput.java:272)  
> > > > ~[elasticsearch-1.2.2.jar:na]  
> > > > at org.elasticsearch.common.io.stream.HandlesStreamInput.readSt  
> > > > ring(HandlesStreamInput.java:61) ~[elasticsearch-1.2.2.jar:na]  
> > > > at org.elasticsearch.common.io.stream.StreamInput.readStringArr  
> > > > ay(StreamInput.java:362) ~[elasticsearch-1.2.2.jar:na]  
> > > > at org.elasticsearch.action.admin.cluster.state.ClusterStateReq  
> > > > uest.readFrom(ClusterStateRequest.java:132)  
> > > > ~[elasticsearch-1.2.2.jar:na]  
> > > > at org.elasticsearch.transport.netty.MessageChannelHandler.hand  
> > > > leRequest(MessageChannelHandler.java:209) ~[elasticsearch-1.2.2.jar:na]  
> > > > at org.elasticsearch.transport.netty.MessageChannelHandler.mess  
> > > > ageReceived(MessageChannelHandler.java:109)  
> > > > ~[elasticsearch-1.2.2.jar:na]
> > > > 
> > > > I didn't find any metioned break change about this exceptioin.
> > > > 
> > > > 在 2014年7月4日星期五UTC+9下午3时31分07秒，David Pilato写道：
> > > > 
> > > > > Well. It depends.
> > > > > 
> > > > > 1.0 is incompatible with 0.90  
> > > > > 1.2 should work with 1.x IIRC.
> > > > > 
> > > > > From 1.0, we try to keep this compatible. If not, release notes will  
> > > > > tell you.
> > > > > 
> > > > > --  
> > > > > David 😉  
> > > > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > > > 
> > > > > Le 4 juil. 2014 à 07:09, xzer LR [xia...@gmail.com](mailto:xia...@gmail.com) a écrit :
> > > > > 
> > > > > For some reasons, we have several separated elasticsearch clusters  
> > > > > for our front applicaitons. We want to upgrade our clusters' version to the  
> > > > > newest version but apparently it is impossible to upgrade all the clusters  
> > > > > at the same time, which means our single application have to connect to  
> > > > > multiple clusters with different versions.
> > > > > 
> > > > > ## My question is whether the elasticsearch java client has the ability to work correctly with an old version server?
> > > > > 
> > > > > You received this message because you are subscribed to the Google  
> > > > > Groups "elasticsearch" group.  
> > > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > > msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40goo  
> > > > > [glegroups.com](http://glegroups.com)  
> > > > > [https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > .  
> > > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > > 
> > > > --  
> > > > You received this message because you are subscribed to the Google  
> > > > Groups "elasticsearch" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit [https://groups.google.com/d/ms](https://groups.google.com/d/ms)  
> > > > gid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%40goo  
> > > > [glegroups.com](http://glegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .  
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > > 
> > > > --  
> > > > You received this message because you are subscribed to the Google  
> > > > Groups "elasticsearch" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > msgid/elasticsearch/df3afd7e-b0a5-4d26-a777-fc887427bbed%  
> > > > [40googlegroups.com](http://40googlegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/df3afd7e-b0a5-4d26-a777-fc887427bbed%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/df3afd7e-b0a5-4d26-a777-fc887427bbed%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .
> > > 
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/86ad8e40-fae6-4581-9972-4c68a0db9d37%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/86ad8e40-fae6-4581-9972-4c68a0db9d37%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/86ad8e40-fae6-4581-9972-4c68a0db9d37%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/86ad8e40-fae6-4581-9972-4c68a0db9d37%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHz3Fvs3PtvoyvH7FcjzG0WDmdSeAwcGB9FvB5ocFGSgQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHz3Fvs3PtvoyvH7FcjzG0WDmdSeAwcGB9FvB5ocFGSgQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![xzer\_LR](https://avatars.discourse-cdn.com/v4/letter/x/2acd7d/32.png) [@xzer\_LR](https://discuss.elastic.co/u/xzer_LR)\
**Post date:** [July 14, 2014, 9:50am UTC](https://discuss.elastic.co/t/can-i-use-the-java-client-of-newer-version-to-connect-to-a-old-version-server/18475/9 "2014-07-14T09:50:41Z")

</div>

Thank you for the comment, according to the source, it seems you are right.

I will try a converse test

在 2014年7月14日星期一UTC+9下午6时36分03秒，Jörg Prante写道：

> You can not connect a newer TransportClient to a server which is older.  
> You can connect an older TransportClient to a newer server (without being  
> able to use new features).
> 
> Jörg
> 
> On Mon, Jul 14, 2014 at 10:36 AM, xzer LR \<[xia...@gmail.com](mailto:xia...@gmail.com) \<javascript:\>\>  
> wrote:
> 
> > I think I got the reason.
> > 
> > At first, I noticed that the row number from the exception stack is not  
> > compatible to the client 1.2.2 source, then it exactly occurred at the old  
> > version 1.0.3 server side.
> > 
> > Then the service side exception told us that it failed from reading the  
> > last string array:
> > 
> > [https://github.com/elasticsearch/elasticsearch/blob/1.0/src/main/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequest.java#L132](https://github.com/elasticsearch/elasticsearch/blob/1.0/src/main/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequest.java#L132)
> > 
> > I recognized that the real problem is the client size did not check the  
> > version correctly, then I digged the source more deeply, then I found the  
> > following row which seems wrong:
> > 
> > [https://github.com/elasticsearch/elasticsearch/blob/1.0/src/main/java/org/elasticsearch/client/transport/TransportClientNodesService.java#L164](https://github.com/elasticsearch/elasticsearch/blob/1.0/src/main/java/org/elasticsearch/client/transport/TransportClientNodesService.java#L164)
> > 
> > DiscoveryNode node = new DiscoveryNode("#transport#-" +  
> > tempNodeIdGenerator.incrementAndGet(), transportAddress, version);
> > 
> > _The nodes passed to construct the transport client are simply  
> > initialized as the current client version._
> > 
> > I have no idea how to fix it but it seems that it should be reported as a  
> > bug?
> > 
> > 在 2014年7月12日星期六UTC+9上午4时29分01秒，Ivan Brusic写道：
> > 
> > > The code is suspicious since it has an explicit check for versions prior  
> > > to 1.2
> > > 
> > > [GitHub - elastic/elasticsearch: Free and Open, Distributed, RESTful Search Engine](https://github.com/elasticsearch/elasticsearch/)  
> > > blob/master/src/main/java/org/elasticsearch/action/admin/cluster/state/  
> > > ClusterStateRequest.java#L121-L124
> > > 
> > > Don't know much else about the code to comment further.
> > > 
> > > Cheers,
> > > 
> > > Ivan
> > > 
> > > On Fri, Jul 11, 2014 at 3:30 AM, xzer LR [xia...@gmail.com](mailto:xia...@gmail.com) wrote:
> > > 
> > > > I am using TransportClient, the following is how I retrieve the client  
> > > > instance:
> > > > 
> > > > Client client = new TransportClient(sb.build()).addTransportAddresses(  
> > > > esAddresses);
> > > > 
> > > > 在 2014年7月11日星期五UTC+9下午6时51分26秒，David Pilato写道：
> > > > 
> > > > > Are you using a TransportClient or NodeClient?  
> > > > > If NodeClient, could you try with the TransportClient?
> > > > > 
> > > > > --  
> > > > > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> > > > > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> > > > > [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> > > > > 
> > > > > Le 11 juillet 2014 à 11:14:59, xzer LR ([xia...@gmail.com](mailto:xia...@gmail.com)) a écrit:
> > > > > 
> > > > > As a test result, I got exceptions when I tried to use the newest  
> > > > > 1.2.2 java client to connect to a 1.0.3 cluster:
> > > > > 
> > > > > 18:05:41.020 [elasticsearch[Slipstream][tra  
> > > > > nsport\_client\_worker][T#1]{New I/O worker #1}] [INFO]   
> > > > > org.elasticsearch.client.transport[105] - [Slipstream] failed to get  
> > > > > local cluster state for [#transport#-1][e-note][inet[/192.168.200.81:9300]],  
> > > > > disconnecting...  
> > > > > org.elasticsearch.transport.RemoteTransportException:  
> > > > > [server-cat][inet[/192.168.21.81:9300]][cluster/state]  
> > > > > java.lang.IndexOutOfBoundsException: Readable byte limit exceeded: 48  
> > > > > at org.elasticsearch.common.netty.buffer.AbstractChannelBuffer.  
> > > > > readByte(AbstractChannelBuffer.java:236) ~[elasticsearch-1.2.2.jar:na]  
> > > > > at org.elasticsearch.transport.netty.ChannelBufferStreamInput.r  
> > > > > eadByte(ChannelBufferStreamInput.java:132)  
> > > > > ~[elasticsearch-1.2.2.jar:na]  
> > > > > at org.elasticsearch.common.io.stream.StreamInput.readVInt(StreamInput.java:141)  
> > > > > ~[elasticsearch-1.2.2.jar:na]  
> > > > > at org.elasticsearch.common.io.stream.StreamInput.readString(StreamInput.java:272)  
> > > > > ~[elasticsearch-1.2.2.jar:na]  
> > > > > at org.elasticsearch.common.io.stream.HandlesStreamInput.readSt  
> > > > > ring(HandlesStreamInput.java:61) ~[elasticsearch-1.2.2.jar:na]  
> > > > > at org.elasticsearch.common.io.stream.StreamInput.readStringArr  
> > > > > ay(StreamInput.java:362) ~[elasticsearch-1.2.2.jar:na]  
> > > > > at org.elasticsearch.action.admin.cluster.state.ClusterStateReq  
> > > > > uest.readFrom(ClusterStateRequest.java:132)  
> > > > > ~[elasticsearch-1.2.2.jar:na]  
> > > > > at org.elasticsearch.transport.netty.MessageChannelHandler.hand  
> > > > > leRequest(MessageChannelHandler.java:209)  
> > > > > ~[elasticsearch-1.2.2.jar:na]  
> > > > > at org.elasticsearch.transport.netty.MessageChannelHandler.mess  
> > > > > ageReceived(MessageChannelHandler.java:109)  
> > > > > ~[elasticsearch-1.2.2.jar:na]
> > > > > 
> > > > > I didn't find any metioned break change about this exceptioin.
> > > > > 
> > > > > 在 2014年7月4日星期五UTC+9下午3时31分07秒，David Pilato写道：
> > > > > 
> > > > > > Well. It depends.
> > > > > > 
> > > > > > 1.0 is incompatible with 0.90  
> > > > > > 1.2 should work with 1.x IIRC.
> > > > > > 
> > > > > > From 1.0, we try to keep this compatible. If not, release notes will  
> > > > > > tell you.
> > > > > > 
> > > > > > --  
> > > > > > David 😉  
> > > > > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > > > > 
> > > > > > Le 4 juil. 2014 à 07:09, xzer LR [xia...@gmail.com](mailto:xia...@gmail.com) a écrit :
> > > > > > 
> > > > > > For some reasons, we have several separated elasticsearch clusters  
> > > > > > for our front applicaitons. We want to upgrade our clusters' version to the  
> > > > > > newest version but apparently it is impossible to upgrade all the clusters  
> > > > > > at the same time, which means our single application have to connect to  
> > > > > > multiple clusters with different versions.
> > > > > > 
> > > > > > ## My question is whether the elasticsearch java client has the ability to work correctly with an old version server?
> > > > > > 
> > > > > > You received this message because you are subscribed to the Google  
> > > > > > Groups "elasticsearch" group.  
> > > > > > To unsubscribe from this group and stop receiving emails from it,  
> > > > > > send an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > > > msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40goo  
> > > > > > [glegroups.com](http://glegroups.com)  
> > > > > > [https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > > .  
> > > > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > > > 
> > > > > --  
> > > > > You received this message because you are subscribed to the Google  
> > > > > Groups "elasticsearch" group.  
> > > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > > msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%40goo  
> > > > > [glegroups.com](http://glegroups.com)  
> > > > > [https://groups.google.com/d/msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > .  
> > > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > > > 
> > > > > --  
> > > > > You received this message because you are subscribed to the Google  
> > > > > Groups "elasticsearch" group.  
> > > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > > msgid/elasticsearch/df3afd7e-b0a5-4d26-a777-fc887427bbed%  
> > > > > [40googlegroups.com](http://40googlegroups.com)  
> > > > > [https://groups.google.com/d/msgid/elasticsearch/df3afd7e-b0a5-4d26-a777-fc887427bbed%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/df3afd7e-b0a5-4d26-a777-fc887427bbed%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > .
> > > > 
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google Groups  
> > > "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/86ad8e40-fae6-4581-9972-4c68a0db9d37%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/86ad8e40-fae6-4581-9972-4c68a0db9d37%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/86ad8e40-fae6-4581-9972-4c68a0db9d37%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/86ad8e40-fae6-4581-9972-4c68a0db9d37%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/060d9aac-793a-40f9-8e78-5400537cc310%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/060d9aac-793a-40f9-8e78-5400537cc310%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![atulsm](https://avatars.discourse-cdn.com/v4/letter/a/df788c/32.png) [@atulsm](https://discuss.elastic.co/u/atulsm)\
**Post date:** [February 13, 2016, 7:45pm UTC](https://discuss.elastic.co/t/can-i-use-the-java-client-of-newer-version-to-connect-to-a-old-version-server/18475/10 "2016-02-13T19:45:57Z")

</div>

To demonstrate how a single java application can connect and query to both elasticsearch1.x and 2.x servers i have a sample application based on classloaders. [https://github.com/atulsm/ElasticsearchClassLoader](https://github.com/atulsm/ElasticsearchClassLoader)

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 13, 2016, 9:12pm UTC](https://discuss.elastic.co/t/can-i-use-the-java-client-of-newer-version-to-connect-to-a-old-version-server/18475/11 "2016-02-13T21:12:51Z")

</div>

That's great. I'd create a new thread for this.

---

<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 5, 2017, 11:16pm UTC](https://discuss.elastic.co/t/can-i-use-the-java-client-of-newer-version-to-connect-to-a-old-version-server/18475/12 "2017-07-05T23:16:35Z")

</div>


