On 5/10/2013 11:39 PM, Shawn Heisey wrote:
On 5/10/2013 8:56 PM, Michael Sokolov wrote:
On 5/10/2013 10:18 PM, Shawn Heisey wrote:
I don't know why I'm not having any trouble. I'm certainly glad that
I'm not, though! Thanks, Shawn
Shawn, one question - in your server setup do you have:

_querySolr.setRequestWriter(new BinaryRequestWriter());

?  I didn't see that - it (used to be) the way you would request
javabin to be used to communicate with the server.

If you don't have that, you are probably using XML format.  I guess we
could just do that, too, at least until all our servers have been
upgraded.
I did a packet capture on the both server versions, the updates that the
client is sending are indeed in XML format.  I find myself a little
surprised by this.  I'm not going to try to change it in production
until I have upgraded everything and lo longer have 3.5.0 in my network,
but I will go ahead and try it on my dev server.

Just to wrap this up; what I ended up doing was to attempt to detect the server version when we start up a new connection, and only use javabin if we are reasonably positive we are talking to a 4.0+ server:

 try {
httpServer.request(new DirectXmlRequest("/admin.html", ""));
                    httpServer.setRequestWriter(new BinaryRequestWriter());
                } catch (SolrException e) {
// There is a backwards-compatibility issue w/javabin; use XML for now
                    // assume this is a 404 ??
getLogger().warn("Could not load /admin.html; assuming this is a < 4.0 server, we won't use javabin format");
                } ...

I don't know if this is really an ideal detection mechanism. Probably this could be done better in Solr/J code somewhere. At the very least there should be warnings in release notes and on the Wiki. If somebody grants me access to the wiki, I'd be happy to write something there to let people know about this issue.

-Mike

Reply via email to