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> |
Hello folks,
I don't know what's going wrong, but I am trying to send a String through a
JxtaBiDiPipe and
I am getting strange results. By the way, I am running the producer and
receiver on the same
machine, different threads.
The producer part is like this:
Message msg = new Message();
StringMessageElement el = StringMessageElement("MESSAGE", "Hello World!",
null);
msg.add("MESSAGE", el);
client.send(msg);
On the other hand, the receiver part is like this:
StringMessageElement me = (StringMessageElement) msg.getElement("MESSAGE");
me.toString();
The message gets delivered, but I noticed that I always receive a
ByteArrayMessageElement,
in spite of sending a StringMessageElement !!!
Anyone here has a clue about this?
Edward