Skip to main content

Propagation of messages

6 replies [Last post]
Anonymous

I want to propagate a message throughout the peers in a group.
I have two peers that connect to one rendezvous.

This snippets should propagate the message throughout the peers of the group:
...
NetManager = new NetworkManager(NetworkManager.ConfigMode.EDGE, "EdgePeer");
NetManager.startNetwork();
RdvSvc = NetManager.getNetPeerGroup().getRendezVousService();
RdvSvc.startApp(null);
EndpointSvc = NetManager.getNetPeerGroup().getEndpointService();
EndpointSvc.startApp(null);
EndpointSvc.addIncomingMessageListener(this, "ServiceListener", null);
Message l_Msg = new Message();
StringMessageElement l_StrMsgElement = new StringMessageElement(null, "BlaBla", null, null);
l_Msg.addMessageElement(l_StrMsgElement);
RdvSvc.propagate(l_Msg, "ServiceListener", null, 10000);
...

This part catches a message and outputs it onto the standard output:
public void processIncomingMessage(Message p_Msg, EndpointAddress p_SrcAddr,
EndpointAddress p_DstAddr) {
System.out.println("IncomingMessage!");
System.out.println(arg0.getMessageElements().next().toString());
}

For some reason only the rendezvous receives the message but does not propagate it to others peers connected to it. When the peers are connected to more then one rendezvous, only the rendezvous receive the messages, but they do not propagate them to edge peers or other rendezvous.
Can anyone give me an advise.

Message was edited by: georgl

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
georgl
Offline
Joined: 2010-10-27

Have recognized that the reference implementation of the jxta framework is obtaining the lease by itself and is updating as needed.

Oct 28, 2010 10:41:58 AM net.jxta.impl.rendezvous.edge.EdgePeerRdvService addRdv
INFO: Renewed RDV lease from RendezvousRelayPeer1 C : 284999 / -15001

I think that there must be an bug in the implementation, because propagations are not received by edge peers, only by rendezvous peers.

georgl
Offline
Joined: 2010-10-27

Have read that a peer needs to obtain a lease to be able to receive propagated messages.
Does anybody know how to do that?

georgl
Offline
Joined: 2010-10-27

Why is there the need to start a peer as rendezvous peer (startRendezVous()) to enable propagation?

georgl
Offline
Joined: 2010-10-27

Problem solved.
Adding this line solved the problem:
RdvSvc.startRendezVous();

Was some kind of timing problem.
Deleting the cache management directory (.jxta/cm) and restarting the peers solved the problem.

But anyway it's some kind of strange, that you have to start the peer as a rendezvous to enable propagation.
I'm wondering if this is a bug.

Message was edited by: georgl

georgl
Offline
Joined: 2010-10-27

Ok. The problem is solved partly.
Had to add the following line:
RdvSvc.startRendezVous();

But propagation is not done throughout rendezvous peers.
Only the message is propagated to peers that are connected to the same rendezvous.

adamman71
Offline
Joined: 2007-01-31

Conversation carried on user list.