-1

what is the alternate of the given below code while migrating it from 3.x.x to 5.x.x using java client

hz.getGroupConfig().setName(HZ_USER);
hz.getGroupConfig().setPassword(HZ_PASSWORD);

solution of the above question please some-one help me in this

Deepak_M
  • 11
  • 4

1 Answers1

1

The group config is replaced with the simple cluster name as shown here

https://docs.hazelcast.com/hazelcast/5.2/migrate/upgrading-from-imdg-3#replacing-group-by-simple-cluster-name-configuration

Basically, the group name is now the cluster name, and the deprecated password is removed altogether, as it was providing false sense of security.

mdumandag
  • 256
  • 2
  • 6
  • So it means that from now onwards we cannot used hzlcastCofig.getGroupConfig().setPassword(HZ_PASSWORD); in 5.2.1 – Deepak_M Dec 23 '22 at 18:23
  • 1
    Yes, there is no replacement for password. If you are an enterprise user, you can take a look at the https://docs.hazelcast.com/hazelcast/5.2/security/native-client-security#authenticating-clients section for different ways of authenticating clients – mdumandag Dec 23 '22 at 18:30
  • can i ask you two more doubts related to hazelcast migration please – Deepak_M Dec 24 '22 at 03:07
  • my first doubt is map.executeOnKey(imsi, new CollectionUnfragAddEntryProcessor( )); – Deepak_M Dec 24 '22 at 03:29
  • alternate of this function in hazelcast config.getNetworkConfig().setConnectionAttemptPeriod() – Deepak_M Dec 24 '22 at 07:28
  • The first one is the same in 5.x series, the same API exists. For the second one, see the https://docs.hazelcast.com/hazelcast/5.2/clients/java#configuring-client-connection-retry section. You can configure the parameters there to achieve what you want – mdumandag Dec 24 '22 at 12:38
  • but sir i'm unable to change this https://stackoverflow.com/questions/74906556/hazelcast-migration-from-3-x-x-to-5-x-x-issue-in-abstractentryprocessor-and-in-s can you help me in that i'm just a fresher please – Deepak_M Dec 24 '22 at 12:41
  • I can't add an answer or comment there as the question is closed, but you should now implement the EntryProcessor interface as shown here https://docs.hazelcast.com/hazelcast/5.2/migrate/upgrading-from-imdg-3#introducing-lambda-friendly-interfaces I would recommend you to take a look at the all the changes in this page for migration from 3.x https://docs.hazelcast.com/hazelcast/5.2/migrate/upgrading-from-imdg-3 – mdumandag Dec 24 '22 at 14:27
  • But sir there is three parameter in the EntryProcessor key,value i know and what i put in the 3 variable ? And i forgot to thank you for the help sir – Deepak_M Dec 24 '22 at 17:48
  • 1
    No problem at all, I am happy to help you. The third parameter represents the result type. So, when you execute map.executeOnKey(key, ep), your entry processor might return some value. In 3.x, the return value type was Object, and now in 5.x it is typed with the generic parameter R. So, you just need to change the R to the old return value type of your entry processor. – mdumandag Dec 24 '22 at 18:31
  • in the given link is valid for 3.x.x version https://jar-download.com/artifacts/com.hazelcast/hazelcast/3.8.4/source-code/com/hazelcast/map/AbstractEntryProcessor.java what can i do with the 5.x.x to implement public AbstractEntryProcessor(boolean applyOnBackup) { if (applyOnBackup) { entryBackupProcessor = new EntryBackupProcessorImpl(); } else { entryBackupProcessor = null; } } – Deepak_M Dec 25 '22 at 15:05
  • Like I said, the details are given in the link. I don't know what you are doing with the entry processor. If you want to run the entry processor on the backup entries as well, you can implement the getBackupProcessor according to your logic – mdumandag Dec 25 '22 at 15:18
  • can you please tell me what is the significance of UUID in the DistributedObjectEvent() because in 3.x.x it is using 4 Arguments but in 5.x.x it is using 5 Arguments. and if possible can you provide the link for that – Deepak_M Dec 29 '22 at 11:19
  • Hi sir can you please take a look tell that whether it is correct or not ? https://stackoverflow.com/questions/74914196/how-to-implement-public-abstractentryprocessorboolean-applyonbackup-in-5-x-x/74915927#74915927 – Deepak_M Dec 29 '22 at 17:29
  • That UUID specifies the source of the event, showing where it originated from. – mdumandag Dec 30 '22 at 07:44
  • 1
    The code shared in that answer is correct, you just need to extend that class in your entry processor and it is done. Regarding the EntryBackupProcessorImpl in your code, it does not exists anymore and you don't need it. Implementing getBackupProcessor as the answer shows is enough – mdumandag Dec 30 '22 at 07:46
  • while upgrading the hz_proxy_server to 5.2.1 i'm getting error com.hazelcast.config.InvalidConfigurationException: cvc-complex-type.2.4.a: Invalid content was found starting with element '{"http://www.hazelcast.com/schema/client-config":group}'. One of '{"http://www.hazelcast.com/schema/client-config":import, "http://www.hazelcast.com/schema/client-config":config-replacers,..... – Deepak_M Dec 30 '22 at 17:55
  • 1
    Since the group config is removed, it is removed from the XML config as well. The link I shared in the answer shows the correct way of doing it. – mdumandag Dec 30 '22 at 19:43
  • Hi sir, can i used UUID.RandomId() in the 5th args if UUID doesn't have significance DistributedObjectEvent newMapEvent = new DistributedObjectEvent(CRTD, "SERVICENAME", "NMAP", mkHzMp,); in the above method we are using 4 args in earlier version but now after upgrading to 5.x.x we are using 5 args 5th is uuid So, my question is that is there is any significance of UUID here then what is it's significance – Deepak_M Dec 31 '22 at 10:52
  • sir please help me in this ques https://stackoverflow.com/questions/74979519/while-upgrading-the-hazelcast-3-12-x-to-5-x-x-then-what-is-the-alternate-of-the – Deepak_M Jan 02 '23 at 07:19
  • Why are you creating those events? You will receive those events when you add distributed object listeners – mdumandag Jan 02 '23 at 13:44
  • so, what will i put in the 5 args of the New DistributedObjectEvent() it required there some uuid ? – Deepak_M Jan 02 '23 at 16:41
  • Like I said, you shouldn't create this object, but If you are using it in your project and not considering it in your logic, you can put a random UUID there – mdumandag Jan 02 '23 at 17:12
  • Hi sir what is the alternate of the given below 2 because if i'm using the then it is giving me this warning /home/deepakmathur/HazelcastUpdate/hzpxy/sec-hz-proxy-server-main/src/test/java/com/evolvedintelligence/common/proxysrv/provLoader/HzcastProxyServerProvisioningLoaderImplTest.java – Deepak_M Jan 03 '23 at 07:31
  • Please sir help in that question please https://stackoverflow.com/questions/74997724/while-upgrading-the-hazelcast-from-3-x-x-ro-5-x-x-im-facing-2-problem-i-e-gi – Deepak_M Jan 03 '23 at 19:15