Hi,
The behavior of the server, for a non-service channel, is that, when
it receives a message, it sends it to all clients that subscribed to
that channel (otherwise the server would do nothing at all).
The server received a message on channel /my/echo and sees that it has
2 clients subscribed: a remote client (you subscribed via the JS API),
and a server-side client you subscribed in EchoService's constructor.
On server-side, delivering that message results in your "echo" method
to be called, where you send again a message to all clients subscribed
to the /my/echo channel.
To solve the issue you have 2 options:
1. The JS client sends a message to a service channel.
2. You don't subscribe your JS client to the /my/echo channel.
You can find references to normal channels vs service channels here:
http://cometd.org/documentation/cometd-javascript/subscription
Simon
--
http://bordet.blogspot.com
---
Finally, no matter how good the architecture and design are,
to deliver bug-free software with optimal performance and reliability,
the implementation technique must be flawless. Victoria Livschitz