Search in sources :

Example 1 with IotHubMessageResult

use of com.microsoft.azure.sdk.iot.device.IotHubMessageResult in project azure-iot-sdk-java by Azure.

the class SampleMessageReceiveCallback method execute.

@Override
public IotHubMessageResult execute(Message msg, Object context) {
    log.debug("Received message with content: {}", new String(msg.getBytes(), Message.DEFAULT_IOTHUB_MESSAGE_CHARSET));
    for (MessageProperty messageProperty : msg.getProperties()) {
        log.debug("{}: {}", messageProperty.getName(), messageProperty.getValue());
    }
    IotHubMessageResult res = IotHubMessageResult.COMPLETE;
    log.debug("Responding to message with {}", res.name());
    return res;
}
Also used : IotHubMessageResult(com.microsoft.azure.sdk.iot.device.IotHubMessageResult) MessageProperty(com.microsoft.azure.sdk.iot.device.MessageProperty)

Aggregations

IotHubMessageResult (com.microsoft.azure.sdk.iot.device.IotHubMessageResult)1 MessageProperty (com.microsoft.azure.sdk.iot.device.MessageProperty)1