Hello, I would like to make use of the new client and while checking https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/breaking-changes.html there are no mentions of changes to connectionClass, however it does not seem to be the case and I am unable to replicate the following:
const client = new Client({
connectionClass: HttpAmazonESConnector,
hosts: [process.env.ES_HOST],
keepAlive: true,
});
Could you please advise how best to go around this or what I'm missing?
Cheers.
Hello! You are right, it's not mentioned in the document.
That parameter is now called Connection. You can find the documentation here.
Still, be aware that Connection classes written for the legacy client will not work with the new client. Since it looks like you are using the aws connection, take a look at https://github.com/TheDeveloper/http-aws-es/issues/63 for more information.
It seems like this Connection class expects one to override a synchronous, non-void request method (per the aforementioned documentation), which doesn't seem to be compatible with any of the AWS methods (which either expect to be void, with a callback, or expose a promise).
A suggested solution was offered back in May, here, but it seems to A) leverage async/await (which I don't believe will work with this Connection class), and B) leverage an AWS.Signers namespace, which seems to be private, per this (and current experience).
We understand that this might be important for you, but this issue has been automatically marked as stale because it has not had recent activity either from our end or yours.
It will be closed if no further activity occurs, please write a comment if you would like to keep this going.
Note: in the past months we have built a new client, that has just landed in master. If you want to open an issue or a pr for the legacy client, you should do that in https://github.com/elastic/elasticsearch-js-legacy
This is still very relevant to anyone using AWS ElasticSearch.
Any work being done on this?
Maybe, these packages will help:
https://www.npmjs.com/package/aws-elasticsearch-connector
https://www.npmjs.com/package/@acuris/aws-es-connection
Most helpful comment
This is still very relevant to anyone using AWS ElasticSearch.