In order to exchange messages between sender and receiver, you need to define a communication channel and protocol (namespace) to do so.
You can use MediaManager to do this for you when the protocol to use is media related (LOAD, PLAY, PAUSE...) or you can create your own. MediaManager creates a CastMessageBus under the hood.
To create your own communication channel and protocol, you need to get either a CastMessageBus or a CastChannel.
If you do not register any communication channel and protocol (namespace), then the sender is going to be unable to communicate with your application.
For a sample receiver look at TicTacToe. As you can see it creates its own CastMessageBus to exchange JSON messages:
TicTacToe.PROTOCOL = 'urn:x-cast:com.google.cast.demo.tictactoe';
this.castMessageBus_ =
this.castReceiverManager_.getCastMessageBus(TicTacToe.PROTOCOL,
cast.receiver.CastMessageBus.MessageType.JSON);
The protocol is just a unique string, starting with 'urn:x-cast:' that you can define and must be used by the receiver and the sender to identify the protocol.