Service domain name in Switchyard clustering
bhaskarsk Apr 18, 2015 3:39 PMI have a cluster of three nodes.
node 1 invokes service1 present on both node2 and node3. All the three nodes are running in standalone mode. ( roundrobin strategy)
I am getting following exception
SWITCHYARD039608: Unable to find ServiceDomain for service: {urn:com.example.sample:service:1.0}EventManager. Verify the service name and namespace are registered in the runtime.
What does service domain regards to when nodes are running in standalone mode. If anything is required like that, how is it set?
I tried implementing custom load balance strategy and print few log statements and fount out the domain is null.
@Override public RemoteEndpoint selectEndpoint(QName serviceName) { System.out.println("Entry selectEndpoint" + count); if (getRegistry() == null) { return null; } RemoteEndpoint selectedEp = null; List<RemoteEndpoint> eps = getRegistry().getEndpoints(serviceName); if (!eps.isEmpty()) { Properties prop=null; try { String filePath=System.getProperty("CONFIG_DIR") + File.separator + propertiesFile; InputStream settingsStream=new FileInputStream(filePath); prop=new Properties(); prop.load(settingsStream); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } String val=prop.get("cluster-nodes").toString(); List<String> nodeList=Arrays.asList(val.split(",")); System.out.println("Clustered nodes" + nodeList); boolean done=false; for(String node:nodeList){ for(RemoteEndpoint remoteEndpoint:eps){ System.out.println(remoteEndpoint.getNode()+" "+remoteEndpoint.getDomainName()+" "+remoteEndpoint.getServiceName()); if(remoteEndpoint.getNode().equals(node)){ System.out.println("selected node:" +remoteEndpoint.getNode()+" "+remoteEndpoint.getDomainName()+" "+remoteEndpoint.getServiceName()); done=true; selectedEp=remoteEndpoint; break; } } if(done){ break; } } } return selectedEp; }
I see the stdout as below, domain name is always null.
22:22:05,944 INFO [stdout] (NioProcessor-30) Entry selectEndpoint1
22:22:05,945 INFO [stdout] (NioProcessor-30) Clustered nodes[node1/switchyard, node2/switchyard, node3/switchyard]
22:22:05,945 INFO [stdout] (NioProcessor-30) node2/switchyard null {urn:com.example.sample:service:1.0}EventManager
22:22:05,945 INFO [stdout] (NioProcessor-30) selected node:node2/switchyard null {urn:com.example.sample:service:1.0}EventManager