public static void main(String[] args) throws InterruptedException {
    InternalDistributedSystem system =
        (InternalDistributedSystem) DistributedSystem.connect(new Properties());
    DistributionManager dm = system.getDistributionManager();
    System.out.println("Got DM: " + dm);

    while (true) {
      DateMessage message = new DateMessage();

      // Make sure that message state was reset
      Assert.assertTrue(message.getDate() == null);
      Assert.assertTrue(message.getRecipients() == null);
      Assert.assertTrue(message.getSender() == null);

      message.setRecipient(DistributionMessage.ALL_RECIPIENTS);
      message.setDate(new Date());

      System.out.println("Produced: " + message);
      dm.putOutgoing(message);
      Thread.sleep(1000);
    }
  }
A little program that periodically produces {@link DateMessage}s.
geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/ProduceDateMessages.java