From 6febd5e31492d5d23975fbde852d1e65573523d7 Mon Sep 17 00:00:00 2001 From: Jeff Mesnil Date: Fri, 22 Sep 2017 16:35:36 +0200 Subject: [PATCH] [ARTMIS-1431] Adapt transport configuration in ClientProtocolManagerFactory add the adaptTransportConfiguration() method to the ClientProtocolManagerFactory so that transport configurations used by the ClientProtocolManager have an opportunity to adapt their transport configuration. This allows the HornetQClientProtocolManagerFactory to adapt the transport configuration received by remote HornetQ broker to replace the HornetQ-based NettyConnectorFactory by the Artemis-based one. JIRA: https://issues.apache.org/jira/browse/ARTEMIS-1431 --- .../service/extensions/xa/recovery/XARecoveryConfig.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/recovery/XARecoveryConfig.java b/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/recovery/XARecoveryConfig.java index 633682426c..292395a55a 100644 --- a/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/recovery/XARecoveryConfig.java +++ b/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/recovery/XARecoveryConfig.java @@ -65,7 +65,11 @@ public class XARecoveryConfig { final ClientProtocolManagerFactory clientProtocolManager) { TransportConfiguration[] newTransportConfiguration = new TransportConfiguration[transportConfiguration.length]; for (int i = 0; i < transportConfiguration.length; i++) { - newTransportConfiguration[i] = clientProtocolManager.adaptTransportConfiguration(transportConfiguration[i].newTransportConfig("")); + if (clientProtocolManager != null) { + newTransportConfiguration[i] = clientProtocolManager.adaptTransportConfiguration(transportConfiguration[i].newTransportConfig("")); + } else { + newTransportConfiguration[i] = transportConfiguration[i].newTransportConfig(""); + } } this.transportConfiguration = newTransportConfiguration;