Re: [jgroups-users] jgroups 4 replacement for Rsp#getSender?

Questions/problems related to using JGroups <[email protected]> Thu, 26 Oct 2017 07:17:41 +0200
Newsgroups gmane.comp.java.javagroups.general
Message-ID <mailman.18301.1508995073.12767.javagroups-users@lists.sourceforge.net>

On 25/10/17 21:05, Questions/problems related to using JGroups wrote:
> Hi,
> 
> We've finally dropped our java 6 requirement and are moving from v3.6.1 
> to v4.0.7.

Excellent!

> I think I've figured out most of the api changes, but can't 
> figure this one out. We have code that wants to know the addresses of 
> nodes that could not be reached when sending a message. For instance:
> 
>          RspList<Object> rspList =
>              messageDisptacher.castMessage(null, msg.getBytes(), 0, 
> msg.length(), <options>);
>          for (Rsp<Object> rsp : rspList.values()) {
>              if (!rsp.wasReceived()) {
>                  // do something with rsp.getSender() here
>              }
>          }
> 
> I can't find an equivalent in jgroups 4.x. Can someone point me in the 
> right direction to figure this out?

Rsp containing a sender was a duplicate, as the sender's address is 
already in the hashmap which RspList extends:

for(Map.Entry<Address,Rsp<Object>> entry: rspList.entrySet()) {
             Address sender=entry.getKey();
             Rsp<Object> rsp=entry.getValue();
             if (!rsp.wasReceived()) {
                 // do something with rsp.getSender() here
                 System.out.printf("no response from %s\n", sender);
             }
         }

> Thanks,
> Bobby
> 
> 
> 
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> 
> 
> 
> _______________________________________________
> javagroups-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/javagroups-users
> 

-- 
Bela Ban | http://www.jgroups.org


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
javagroups-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/javagroups-users