-
1. Re: port from 4.2.3 to as7
rhusar Nov 13, 2012 3:35 PM (in response to crazycradd)1 of 1 people found this helpfulHey Peter,
not sure what are you trying to achieve, sounds like you want the physical address out of cluster nodes and how to do that in AS7?
Here is a quick code snippet, what you need to do is to ask JGroups transport what the logical cluster member names stand for in IP address terms:
@Resource(lookup = "java:jboss/infinispan/container/web")
private EmbeddedCacheManager container;
...
info.append("Physical addresses: ");
JGroupsTransport transport = (JGroupsTransport) container.getTransport();
for (Address infinispanWrapAddr : container.getMembers()) {
JGroupsAddress jgroupsWrapAddr = (JGroupsAddress) infinispanWrapAddr;
org.jgroups.Address physAddr = (org.jgroups.Address) transport.getChannel().down(new Event(Event.GET_PHYSICAL_ADDRESS, jgroupsWrapAddr.getJGroupsAddress()));
IpAddress ipAddr = (IpAddress) physAddr;
info.append(ipAddr.getIpAddress().getHostAddress()).append(":").append(((IpAddress) physAddr).getPort()).append("; ");
}
...
Or look at the code here: https://github.com/clusterbench/clusterbench/blob/master/clusterbench-ee6-web/src/main/java/org/jboss/test/clusterbench/web/debug/DebugServlet.java
HTH,
Rado
-
2. Re: port from 4.2.3 to as7
crazycradd Nov 20, 2012 11:11 AM (in response to rhusar)Thanks for this its a step in the right direction.
I'm trying to provide the client with a list or remote servers and ports that can be used to create a jndi PROVIDER_URL that I have read will be supported in 7.2
The port given in the sample above is the jgroups port is there anyway to get the remoting port ? I can assume its x +y since I use a tool to configure the appserver binding group but it would be nice to get this programatically rather than guess what it should be.