[jgroups-users] Porting-Guide/Release-Notes between 3.6.14 and 4.0.15
Brought to you by:
belaban
|
From: Questions/problems r. to u. J. <jav...@li...> - 2020-01-27 14:50:11
|
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); } }); } |