You are focussing on the wrong level. My question is not why it isn't working with or without the backslash. But why the behaviour of the same request is handled differently by the docker container than by the elastico cloud service.
The following lines are captured by WireShark
"38773","228.447656","127.0.0.1","127.0.0.1","HTTP","568","POST /queue_1/_update_by_query HTTP/1.1 (text/plain)"
"38923","450.564002","127.0.0.1","127.0.0.1","HTTP","567","POST queue_1/_update_by_query HTTP/1.1 (text/plain)"
Both lines are giving a 200 when they are run against docker. If similar requests are run against elastic cloud. Only the first line (with the leading slash would work). My question is not why is the slash needed, but rather why is the docker behaving differently than elastic search. Because that way I will notice errors against this in my integration tests.
But to answer your question. At the moment I'm using the org.elasticsearch.client.Restclient from org.elasticsearch.client:elasticsearch-rest-client:5.6.4. I'm using org.elasticsearch.client.RestClient#performRequest(java.lang.String, java.lang.String, java.util.Map<java.lang.String,java.lang.String>, org.apache.http.Header...). And it's in the endpoint parameter that should start with a slash