ByteArrayMessageElement and StringMessageElement
Edward Ribeiro <[email protected]> Wed, 14 Sep 2005 12:33:32 -0300
| Newsgroups | gmane.comp.java.jxta.user,gmane.comp.java.jxta.devel |
|---|---|
| Message-ID | <123dcca05091408333bfaa8cc__31562.5084833757$1126712186$gmane$org@mail.gmail.com> |
------=_Part_166_28167681.1126712012711
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Hello folks,
I don't know what's going wrong, but I am trying to send a String through =
a=20
JxtaBiDiPipe and
I am getting strange results. By the way, I am running the producer and=20
receiver on the same
machine, different threads.
The producer part is like this:
Message msg =3D new Message();
StringMessageElement el =3D StringMessageElement("MESSAGE", "Hello World!",=
=20
null);
msg.add("MESSAGE", el);
client.send(msg);
On the other hand, the receiver part is like this:
StringMessageElement me =3D (StringMessageElement) msg.getElement("MESSAGE=
");
me.toString();
The message gets delivered, but I noticed that I always receive a=20
ByteArrayMessageElement,
in spite of sending a StringMessageElement !!!=20
Anyone here has a clue about this?
Edward
------=_Part_166_28167681.1126712012711
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
<div>Hello folks,</div>
<div> </div>
<div>I don't know what's going wrong, but I am trying to send a String thro=
ugh a JxtaBiDiPipe and</div>
<div>I am getting strange results. By the way, I am running the producer an=
d receiver on the same</div>
<div>machine, different threads.</div>
<div> </div>
<div>The producer part is like this:</div>
<div> </div>
<div>Message msg =3D new Message();</div>
<div>StringMessageElement el =3D StringMessageElement("MESSAGE", =
"Hello World!", null);</div>
<div>msg.add("MESSAGE", el);</div>
<div>client.send(msg);</div>
<div> </div>
<div>On the other hand, the receiver part is like this:</div>
<div> </div>
<div>StringMessageElement me =3D (StringMessageElement) msg.getElement(&quo=
t;MESSAGE");</div>
<div>me.toString();</div>
<div> </div>
<div>The message gets delivered, but I noticed that I always receive a Byte=
ArrayMessageElement,</div>
<div>in spite of sending a StringMessageElement !!! </div>
<div> </div>
<div>Anyone here has a clue about this?</div>
<div> </div>
<div>Edward</div>
------=_Part_166_28167681.1126712012711--