[jgroups-users] Porting-Guide/Release-Notes between 3.6.14 and 4.0.15
Questions/problems related to using JGroups <[email protected]> Mon, 27 Jan 2020 09:49:52 -0500
| Newsgroups | gmane.comp.java.javagroups.general |
|---|---|
| Message-ID | <mailman.38172.1580136612.1370.javagroups-users@lists.sourceforge.net> |
--===============3609584181537278027==
Content-Type: multipart/alternative; boundary="000000000000df59a5059d203810"
--000000000000df59a5059d203810
Content-Type: text/plain; charset="UTF-8"
Hi:
Can someone point me to a porting guide - trying to port code between
3.6.14 and 4.0.15.
(e.g. things that will break and must be chagned between 3 and 4?)
We use the jgroups library in a "deployed" application on the JBoss EAP7
platform, currently trying to
upgrade between EAP7.1.x and 7.2.X, the JBoss upgrade changes jgroups
between 3.6.14 and 4.0.15.
Some of the inital issues was are facing include, any hints/suggestions
would be greatly appreciated.
a) Issue related to:
https://issues.redhat.com/browse/JGRP-1860
Bela already provided an inital answer. See [1] below for more details.
b) org.jgroups.util.UUID is NOT backwards compatibile
See [2] for more details.
c) Channel deprecated. Can we just change all uses of "Channel" to
"JChannel" and all will be OK?
d) org.jgroups.timeoutexception was removed. Can I simply import
java.util.concurrent.timeoutexception in
place of org.jgroups.timeoutexception?
e) ... tbd
Cheers
[1] In jgroups-3.6.14.Final-redhat-1.jar (EAP7.1.4)
org.jgroups.blocks.RpcDispatcher had a static interface defined.
public static interface Marshaller {
public Buffer objectToBuffer(Object var1) throws Exception;
public Object objectFromBuffer(byte[] var1, int var2, int var3)
throws Exception;
}
In 4.0.15 there is now a Interface Marshaller with completely different
methods/parameters.
Any suggestions?
[2] With jgroups jgroups-3.6.14.Final-redhat-1.jar (EAP7.1.4) we extended
org.jgroups.util.UUID to
create our ToddsPayloadUUID and add
String(s) ipAddress, port and hostname (which are used by our application).
Unfortunately in 4.0.15 org.jgroups.util.UUID is missing some methods we
used, including:
size(), readExternal(), writeExternal(), writeTo(), readFrom()
When we create a JChannel, we add the class to the ClassConfigurator with:
org.jgroups.conf.ClassConfigurator.add(1025, ToddsPayloadUUID.class);
We then call the create/add and AddressGenerator to the channel - code
snippet:
private static Channel createSamChannel (String aInProps)
{
...
try
{
myC = new JChannel(aInProps);
createSamChannelLogger.logActivity("Create JChannel with
config=" + aInProps);
System.out.println("Create JChannel with config=" + aInProps);
myC.addAddressGenerator(new AddressGenerator()
{
// Set Address Generator to SamPayloadUUID and set
IpAddress and port to be what is
//configured in the jgroup configuration
public Address generateAddress()
{
Map
lTcpMap=com.timetra.nms.server.multiserver.core.common.Util.getJGroupElement("TCP");
String ipAddress =(String) lTcpMap.get("bind_addr");
String port = (String) lTcpMap.get("bind_port");
String hostname;
try
{
hostname =
InetAddress.getByName(ipAddress).getHostName();
}
catch (UnknownHostException e)
{
hostname = ipAddress;
}
return (Address)SamPayloadUUID.randomUUID(ipAddress,
port, hostname);
}
});
}
--000000000000df59a5059d203810
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Hi:<br>=C2=A0Can someone point me to a porting guide - try=
ing to port code between 3.6.14 and 4.0.15.<br>=C2=A0(e.g. things that will=
break and must be chagned between 3 and 4?)<br>=C2=A0<br>=C2=A0We use the =
jgroups library in a "deployed" application on the JBoss EAP7 pla=
tform, currently trying to<br>=C2=A0upgrade between EAP7.1.x and 7.2.X, the=
JBoss upgrade changes jgroups between 3.6.14 and 4.0.15.<br>=C2=A0<br>=C2=
=A0Some of the inital issues was are facing include, any hints/suggestions =
would be greatly appreciated.<br>=C2=A0<br>=C2=A0a) Issue related to:<br>=
=C2=A0<a href=3D"https://issues.redhat.com/browse/JGRP-1860">https://issues=
.redhat.com/browse/JGRP-1860</a><br>=C2=A0<br>=C2=A0Bela already provided a=
n inital answer.=C2=A0 See [1] below for more details.<br>=C2=A0<br>=C2=A0b=
) =C2=A0org.jgroups.util.UUID is NOT backwards compatibile<br>=C2=A0See [2]=
for more details.<br>=C2=A0<br>=C2=A0c) Channel deprecated.=C2=A0 Can we j=
ust change all uses of "Channel" to "JChannel" and all =
will be OK?<br>=C2=A0<br>=C2=A0d) org.jgroups.timeoutexception was removed.=
=C2=A0 Can I simply import java.util.concurrent.timeoutexception in<br>=C2=
=A0place of org.jgroups.timeoutexception?<br>=C2=A0<br>=C2=A0e) ... tbd<br>=
=C2=A0<br>=C2=A0Cheers<br><br>=C2=A0<br>=C2=A0[1] In jgroups-3.6.14.Final-r=
edhat-1.jar (EAP7.1.4) org.jgroups.blocks.RpcDispatcher had a static interf=
ace defined.<br><br>=C2=A0 =C2=A0 public static interface Marshaller {<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 public Buffer objectToBuffer(Object var1) throw=
s Exception;<br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 public Object objectFromBuf=
fer(byte[] var1, int var2, int var3) throws Exception;<br>=C2=A0 =C2=A0 }<b=
r> <br>In 4.0.15 there is now a Interface Marshaller with completely differ=
ent methods/parameters. <br>Any suggestions? <br>=C2=A0<br>[2] With jgroups=
jgroups-3.6.14.Final-redhat-1.jar (EAP7.1.4) we extended org.jgroups.util.=
UUID to <br>create our ToddsPayloadUUID and add <br>String(s) ipAddress, po=
rt and hostname (which are used by our application).<br><br>Unfortunately i=
n 4.0.15 org.jgroups.util.UUID is missing some methods we used, including:<=
br>size(), readExternal(), writeExternal(), writeTo(), readFrom()<br><br>Wh=
en we create a JChannel, we add the class to the ClassConfigurator with:<br=
><br>=C2=A0org.jgroups.conf.ClassConfigurator.add(1025, ToddsPayloadUUID.cl=
ass);<br><br>We then call the create/add and AddressGenerator to the channe=
l - code snippet:<br><br><br>=C2=A0 =C2=A0 private static Channel createSam=
Channel (String aInProps)<br>=C2=A0 =C2=A0 {<br>...<br><br>=C2=A0try<br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 {<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 myC=
=3D new JChannel(aInProps);<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 c=
reateSamChannelLogger.logActivity("Create JChannel with config=3D"=
; + aInProps);<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 System.out.prin=
tln("Create JChannel with config=3D" + aInProps);<br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 myC.addAddressGenerator(new AddressGenerato=
r()<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {<br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 // Set Address Generator to SamPayloadUU=
ID and set IpAddress and port to be what is<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 //configured in the jgroup configuration<br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 public Address generat=
eAddress()<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Map l=
TcpMap=3Dcom.timetra.nms.server.multiserver.core.common.Util.getJGroupEleme=
nt("TCP");<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 String ipAddress =3D(String) lTcpMap.get("bind_ad=
dr");<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 String port =3D (String) lTcpMap.get("bind_port");<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Strin=
g hostname;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 try<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 {<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 hostname =3D InetAddress.getByName(ipAddress).g=
etHostName();<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 }<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 catch (UnknownHostException e)<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 hostname =3D ipAdd=
ress;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 }<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 return (Address)SamPayloadUUID.randomUUID(ipAddress, port, hostname);<b=
r>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 });<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br></d=
iv>
--000000000000df59a5059d203810--
--===============3609584181537278027==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
--===============3609584181537278027==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
javagroups-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/javagroups-users
--===============3609584181537278027==--