code: public static String addTo(Message message) {
          if (message.getStanzaId() == null) {
              message.setStanzaId(StanzaIdUtil.newStanzaId());
          }
          message.addExtension(new DeliveryReceiptRequest());
          return message.getStanzaId();
      }
docs: Add a delivery receipt request to an outgoing packet.
  
  Only message packets may contain receipt requests as of XEP-0184,
  therefore only allow Message as the parameter type.
  
  @param message Message object to add a request to
  @return the Message ID which will be used as receipt ID