users@shoal.java.net

Re: [Shoal-Users] sending targetted messages to peers

From: Jerry Raj <jerryr_at_sun.com>
Date: Mon, 15 Jun 2009 21:02:35 +0530

Hi Shreedhar,
I have a case where each peer in the group needs to send certain peer-specific
data to every other peer in the group. So when a new peer joins, it broadcasts
its data to the group. Each existing member then sends own data to the new
joinee. I was trying to have a single codepath for both cases, so I needed a way
to avoid a loop where the new joinee then again replies with its data and thus
triggers a loop. It would have been simple if I could extract targetServerToken
from the Message.

Its simple enough to work around, I simply have two message types, one for
broadcasts and one for replies.

-Jerry

Shreedhar Ganapathy wrote:
> Hi Jerry
> The messaging API does not provide any means of knowing how a message
> was sent. So far,we have not had reasons to have this added to the
> message payload. Could you share a use case where this is useful?
>
> Thanks
> Shreedhar
>
> Jerry Raj wrote:
>> Hi,
>> I'm trying to send a message to a particular node in the network. I'm
>> using the
>> GroupHandle.sendMessage(targetServerToken, targetComponentName,
>> message) method.
>> The message gets delivered fine, but how can the recipient tell
>> whether this
>> message was sent explicitly to it, or was broadcast generally to the
>> whole
>> group? I could not find a way other than encoding this data into the
>> message
>> byte array itself.
>>
>> Thanks
>> -Jerry
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_shoal.dev.java.net
>> For additional commands, e-mail: users-help_at_shoal.dev.java.net
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_shoal.dev.java.net
> For additional commands, e-mail: users-help_at_shoal.dev.java.net
>