diff --git a/clustering/jgroups/src/main/java/org/jboss/as/clustering/jgroups/subsystem/ChannelInstanceResourceDefinition.java b/clustering/jgroups/src/main/java/org/jboss/as/clustering/jgroups/subsystem/ChannelInstanceResourceDefinition.java index 2522bf6fd986..6096b4fed5a8 100644 --- a/clustering/jgroups/src/main/java/org/jboss/as/clustering/jgroups/subsystem/ChannelInstanceResourceDefinition.java +++ b/clustering/jgroups/src/main/java/org/jboss/as/clustering/jgroups/subsystem/ChannelInstanceResourceDefinition.java @@ -220,6 +220,12 @@ public static void registerChannelProtocolMetrics(OperationContext context, Stri protocolDefinitions.add(protocolDefinition); } + // create the relay resource definition if element is defined + ResourceDefinition relayDefinition = null ; + if (stack.hasDefined(ModelKeys.RELAY)) { + relayDefinition = getProtocolMetricResourceDefinition(context, channelName, "relay.RELAY2"); + } + // register the channel resource and its protocol resources ManagementResourceRegistration subsystemRootRegistration = context.getResourceRegistrationForUpdate(); ManagementResourceRegistration channelRegistration = subsystemRootRegistration.registerSubModel(new ChannelInstanceResourceDefinition(channelName, true)); @@ -227,6 +233,9 @@ public static void registerChannelProtocolMetrics(OperationContext context, Stri for (ResourceDefinition protocolDefinition : protocolDefinitions) { channelRegistration.registerSubModel(protocolDefinition); } + if (stack.hasDefined(ModelKeys.RELAY)) { + channelRegistration.registerSubModel(relayDefinition); + } } public static void addChannelProtocolMetricsDeregistrationStep(OperationContext context, String channelName) {