Skip to main content
Version: IOTA

Post a Message


A message is an encapsulating data structure that is being actually broadcast across the network. It is an atomic unit that is either accepted or rejected as a whole.

The simplest message you can broadcast is a message without any particular payload, as shown in the following examples.

You can use the Client.message() to easily send any message over the network. Alternatively, there is a convenient MessageSender helper class with chaining calls that prepares a message instance and broadcasts it over the network.

public static void simpleMessage() {
try {
Client iota = node();
Message message = iota.message().finish();

"Empty message sent:" +;
} catch (ClientException e) {
System.out.println("Error: " + e.getMessage());

Output example:

message: {
networkId: '14379272398717627559',
parentMessageIds: [
payload: null,
nonce: '9223372036854784215'
messageId: '10dbee9cf3c58507725861b34ac711058dc13f709be1a6d21f1dc0af17b06379'
  • messageId is a unique id that refers to the given message in the network.