String key = EndpointSupport.getUniqueKey(endpoint);
ComponentStats compStats = componentStats.get(endpoint.getComponentNameSpace().getName());
EndpointStats stats = new EndpointStats(endpoint, compStats.getMessagingStats());
endpointStats.putIfAbsent(key, stats);
// Register MBean
ManagementContext context = container.getManagementContext();
try {
context.registerMBean(context.createObjectName(context.createObjectNameProps(stats, true)),
stats,
EndpointStatsMBean.class);
} catch (Exception e) {
LOGGER.info("Unable to register endpoint statistics MBean: {}", e.getMessage());
LOGGER.debug("Unable to register endpoint statistics MBean", e);