RE: Individual Members of PeerGroup

"Poole, Paul P1" <[email protected]> Wed, 21 Sep 2005 10:47:40 -0400
Newsgroups gmane.comp.java.jxta.user
Message-ID <[email protected]>
Mohamed,

Regarding: "OutputPipe op = pipeSerivce.createOutputPipe(propPipeAdv,
Collections.singleton(src_pid), 1);"

I ran into one problem with this... If the src_pid belongs to the
rendezvous peer, it fails.  Is this a bug?  Do you know of any good
workarounds?  I am using a history list (based on an LRU cache, per your
suggestion) to obtain a list of peers.  Sometimes one of the peers
selected is a rendezvous... When this happens, a message is sent, but
the rdv peer never receives this message.  This is problematic for
message recovery in a two node scenario since the only other node to
request missed messages from is the rendezvous.

Thanks for your assistance,

Paul

-----Original Message-----
From: Mohamed Abdelaziz [mailto:[email protected]] 
Sent: Monday, September 12, 2005 3:55 PM
To: [email protected]
Subject: Re: [JXTA user] Individual Members of PeerGroup


PipeMessage should define and include source PID, IMO is it a missing 
feature. However, in the interim. Exchange src id in the message, and to

convert a string into a peerid can be easily done through :

try {
                pid =(PeerID) IDFactory.fromURI(new URI(pidStr)); }
catch (Exception ex) {}


The problem with using the list of peers connected to a rendezvous, is 
the assumption that such peers are subscribers to the communication 
channel, in addition, the pipe service does not expose any api's to 
access the list of subscribers. That said, the simplest way to do this 
without extending the core services is to use a dynamic list.

I would also add the dynamic list should be an LRU cache to ensure a 
fresh list (the JXME project has a class which fits this purpose see:  
http://jxme.jxta.org/source/browse/jxme/proxyless/proto/src/net/jxta/imp
l/cm/LRUCache.java?rev=1.2&view=auto&content-type=text/vnd.viewcvs-marku
p).


Mohamed

-- 
http://blogs.sun.com/roller/page/hamada
http://weblogs.java.net/blog/hamada



Poole, Paul P1 wrote:

>Ok... So, I have implemented my recovery thread according to our 
>conversation.  Of course, now I have a different problem :-)
>
>On the rendezvous, I can do the following to get a Vector of peers 
>(IDs) currently connected to the rdv: 
>pg.getRendezVousService().getConnectedPeerIDs();
>
>However, from an edge peer, this returns an empty vector (looking at 
>the service implementation for an edge peer, I can see why).  Mohamed, 
>in one of your earlier replies, you had recommended that I "keep track 
>of peers over the course of communication and dynamically augment the 
>random set of peers" -- My problem here is that as each message is 
>received, I have no way of identifying the sender unless I tag the 
>message with a message element identifying the sender (which I do 
>this). The problem here is that the tag provides me with a String of 
>the PeerID, but I need the PeerID object to call 
>pipeSerivce.createOutputPipe()...  Is there some other way to identify 
>the sender?  Also, although a communication history could work, I am a 
>little afraid of creating a stale list (due to high churn rate)... So, 
>my preference is a solution whereby I can obtain the latest list of 
>connected peers.  Is there another route for this (for the edge peers)?
>
>
>I apologize for all the questions, but I can't seem to find the answers

>elsewhere...
>
>Thanks,
>
>Paul
>
>-----Original Message-----
>From: Mohamed Abdelaziz [mailto:[email protected]]
>Sent: Monday, September 12, 2005 11:25 AM
>To: [email protected]
>Subject: Re: [JXTA user] Individual Members of PeerGroup
>
>
>Creating a propagate output pipe has very little cost associated with
>it.  I suggest creating a new one when needed, then discarding it.
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]