EndpointManager endpointManager = new EndpointManager(registry);
Endpoint ep1 = endpointManager.newEndpoint("jms:/Service1");
endpointManager.addEndpoint(ep1);
Endpoint ep2 = endpointManager.newEndpoint("jms:/Service2");
ep2.setAttribute(CommonConstants.ENDPOINT_ENVIRONMENT_ATTR, "QA");
endpointManager.addEndpoint(ep2);
service.attachEndpoint(ep1);
service.attachEndpoint(ep2);