It does mean that every time we add or change a message type in the messaging system we need to change the gateway class. But we would have to change the calling code anyway, and at least this way the compiler can help us find clients and check for errors. There's another problem. When we get an error with this interface it tells us by giving us a return error code. A return code of 0 indicates success, anything else is an error.
Different numbers indicate different errors.
In Java you throw an exception to indicate an error. So the gateway methods should throw exceptions rather than return error codes. The full range of possible errors is something that we will naturally ignore. The return codes are defined in the messaging system's interface. The unknown message type error indicates an error in the gateway class, since any client is only calling a fully explicit method, clients should never generate this error.