Skip to main content

Problem to discovery peers in custom peer group

14 replies [Last post]
karn18
Offline
Joined: 2006-05-05

Hello, I have a problem about searching peers in a custom peer group.
I created my custom peer group and join it. When searching peers in the group.
I just saw only one peers in custom group.
So I found many threads about this problems. Many answers told to set one peer in the custom peer group to be a rendezvous.
I tried to work like that however it did not work. Could anyone give me some source about that program to discover peers in a custom peer group or describe how to make it work in details? Thanks.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
adamman71
Offline
Joined: 2007-01-31

Hi karn18,

I will try to take a look at this in the comming weeks when I have more time.

Cheers,

J.

karn18
Offline
Joined: 2006-05-05

The attach file is my source code. In PeerDiscovery.java, it has method to create my
own peer group, join peer group and discovery peers in my own peer group.
Could anyone help me to find out the problem that I cannot discovery peers in my
own peer group?

My code run with JXTA 2.4.1 because I must use JXTA-Meteor that
compatibles with 2.4.1

Thank you very much in advanced.

enygma2002
Offline
Joined: 2008-12-22

I also had this problem with both public and private groups.

This is the solution that worked for me:
http://forums.java.net/jive/thread.jspa?threadID=56320&tstart=0 (see the conclusion)

adamman71
Offline
Joined: 2007-01-31

> I also had this problem with both public and private
> groups.
>
> This is the solution that worked for me:
> http://forums.java.net/jive/thread.jspa?threadID=56320
> &tstart=0 (see the conclusion)

Hi Enygma,

Can you share your code example (even if it does not work on 2.4.1)?

Thanks,

J.

jtanago
Offline
Joined: 2008-06-18

Hi!

I've been reading some posts similiar to this, and I wonder if it could be more interesting use a RendezvousListener and check events like CLIENTCONNECT to realized if a peer has just connected.

Thanks

adamman71
Offline
Joined: 2007-01-31

Hi,

This would not work in a large peergroup, because there can be several RDVs. Edge peers would connect to different RDVs, so you would not get a global view.

Cheers,

J.

jtanago
Offline
Joined: 2008-06-18

Hi!

Thanks for your time,

Then, would be using getRemoteAdvertisement periodically the best approach?

Thanks again

adamman71
Offline
Joined: 2007-01-31

> Hi!
>
> Thanks for your time,
>
> Then, would be using getRemoteAdvertisement
> periodically the best approach?
>
> Thanks again

Yes and no.

If you need to permanently know who is online in your peergroup: I would use the getRemoteAdvertisement to find out about the ID of peers in your peergroup and I would store the list locally. I would use the list to probe for new peer Ids periodically using that list recursively if you understand what I mean.

Now, it is not because you know the ID of a peer that it is necessarily online. In addition, it is not because a peer is online that you will necessarily know it with the getRemoteAdvertisement method.

To find out, I would use a ping-like such as the one I have provided at www.practicaljxta.com and ping peers from time to time using their ID.

Now, keep in mind that if there is 50.000 peers online in your peer group, it will put trumendous stress on the peer trying to monitor the presence of everyone in your
peergroup.

Cheers,

J.

jtanago
Offline
Joined: 2008-06-18

Hi!

I've seen a method called "walk" (RendezvousService class) that looks interesting to notifying your presence to the rest of the group. What do you think about it?

Thanks for your time

adamman71
Offline
Joined: 2007-01-31

As far as I know, this is specific to the RDV service. I would not mess with it. Beside, you can't be 100% sure it won't be modified in future releases of JXTA...

J.

jtanago
Offline
Joined: 2008-06-18

Hi!

Thanks for your time, you're being very clear!

Then, I'm thinking about using a shared pipe that belongs to the group. So, when a peer joins a group, he sends a message through that pipe to say "hello". But I've one doubt, what would be the best approach? A propagated pipe? A BiDi pipe?

This question reminds me of a question I have for several days. When a peer joins a group, he's ready to receive messages from the rendezvous, so he already has a pipe open, but what I had understood was that you had to create a pipe advertisement explicitly to keep a communication with a peer or peers. (that's, get the pipe service from the group, create the pipe advertisement and publish it). What have I misunderstood?

Thanks

adamman71
Offline
Joined: 2007-01-31

> Hi!
>
> Thanks for your time, you're being very clear!
>
> Then, I'm thinking about using a shared pipe that
> belongs to the group. So, when a peer joins a group,
> he sends a message through that pipe to say "hello".
> But I've one doubt, what would be the best approach?
> A propagated pipe? A BiDi pipe?
>

A JXTA Multicast Socket would be a good candidate.

> This question reminds me of a question I have for
> several days. When a peer joins a group, he's ready
> to receive messages from the rendezvous, so he
> already has a pipe open, but what I had understood
> was that you had to create a pipe advertisement
> explicitly to keep a communication with a peer or
> peers. (that's, get the pipe service from the group,
> create the pipe advertisement and publish it). What
> have I misunderstood?
>
> Thanks

The RDV service has its own way to communicate with
other peers. I don't think it is a good idea to try to 'hijack'
it for your own purposes. Use other tools provided by
JXTA.

Cheers,

J.

jtanago
Offline
Joined: 2008-06-18

Hi!

Thanks again!!

> A JXTA Multicast Socket would be a good candidate.

But, does JXTA Multicast Socket works through different LANs?

>The RDV service has its own way to communicate with
>other peers. I don't think it is a good idea to try to 'hijack'
>it for your own purposes. Use other tools provided by
>JXTA.

Then, if I want to communicate two peers to keep a conversation:
1) Peer1 joins a group. He gets the pipe service from the group and create a pipeadvertisement for himself. He publish it.
2) Peer2 who wants to talk Peer1, calls getRemoteAdvertisements method and searchs for the pipe advertisement that matches the Peer1.

But, I've reading your book (the BiDiPipe section) and I realized that one peer has to act as a Server and the other one has to know the pipe adv of the other peer. Peer2 knows the pipe adv of Peer1, but Peer1 can't act as a server because he doesnt know that a peer wants to communicate with him, do you understand me?

Thanks for your help!

spiritofnight
Offline
Joined: 2008-10-22

There could be many things causing this problem.

I had the same problem, and it was due to a misconfiguration that lead all my peers to act as the same (they were using the same cache, so same PeerAdv, PeerID, GroupAdv...). (All peers were on the same computer)

- If you [u]run CustomGroupService tutorial[/u] in your peers, we may discard configuration mistakes. Have you tried it yet?
Do you see different PeerID's in the output?

That's all I can say for now.
I hope it helps you.