Example usage for org.springframework.integration.xmpp XmppHeaders TO

List of usage examples for org.springframework.integration.xmpp XmppHeaders TO

Introduction

In this page you can find the example usage for org.springframework.integration.xmpp XmppHeaders TO.

Prototype

String TO

To view the source code for org.springframework.integration.xmpp XmppHeaders TO.

Click Source Link

Usage

From source file:org.springframework.integration.xmpp.ignore.XmppMessageProducer.java

public Message<String> receive() {
    try {/* w  w w . j av  a  2 s .c o  m*/
        if (counter > 10) {
            logger.debug("return null");
            return null;
        }
        counter += 1;
        Thread.sleep(1000 * 2);

        String msg = "the current time is " + new Date();

        logger.info("sending message to recipient " + recipient);

        return MessageBuilder.withPayload(msg).setHeader(XmppHeaders.TO, recipient).build();
    } catch (InterruptedException e) {
        logger.debug("exception thrown when trying to receive a message", e);
    }
    return null;
}