From c32a4324b03d66508e125d34cc5bc1031ef25367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20B=C3=BCscher?= Date: Fri, 5 Aug 2016 14:11:01 +0200 Subject: [PATCH] Add NamedWriteables from plugins to TransportClient Plugins provide NamedWriteables that are added to the NamedWriteableRegistry. Those are added on Nodes already, the same mechanism is added to the setup for TransportClient. --- .../org/elasticsearch/client/transport/TransportClient.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/main/java/org/elasticsearch/client/transport/TransportClient.java b/core/src/main/java/org/elasticsearch/client/transport/TransportClient.java index e5538aa9917..aa11b389555 100644 --- a/core/src/main/java/org/elasticsearch/client/transport/TransportClient.java +++ b/core/src/main/java/org/elasticsearch/client/transport/TransportClient.java @@ -124,6 +124,9 @@ public abstract class TransportClient extends AbstractClient { List entries = new ArrayList<>(); entries.addAll(networkModule.getNamedWriteables()); entries.addAll(searchModule.getNamedWriteables()); + entries.addAll(pluginsService.filterPlugins(Plugin.class).stream() + .flatMap(p -> p.getNamedWriteables().stream()) + .collect(Collectors.toList())); NamedWriteableRegistry namedWriteableRegistry = new NamedWriteableRegistry(entries); ModulesBuilder modules = new ModulesBuilder();