Hi all, I’m confused. In the messageReceived method the first parameter is the source (who issues the message), but in the next example of the tutorials, it doesn’t seems.
public class ClientListener implements MessageListener {
public void messageReceived(Client source, Message message) {
if (message instanceof HelloMessage) {
// do something with the message
HelloMessage helloMessage = (HelloMessage) message;
System.out.println(“Client #”+source.getId()+” received: ‘”+helloMessage.getSomething()+”‘”);
} // else…
}
Here, the source is who received the message. This message was sent from the server, therefore it is the issuer and not the client.
can anybody help me???