public void sendEvent(String connectionId, String eventBody, Handler<AsyncResult<Void>> handler) { System.out.printf("moduleConnectionIdEventPut called for %s%n", connectionId); System.out.println(eventBody); this.sendEventHelper(connectionId, new Message(eventBody), handler); }
@Override public void logEvent(String event, Map<String, Object> producerConfig) { this.deviceClient.sendEventAsync(new Message(event), null, null); }
public void sendOutputEvent(String connectionId, String outputName, String eventBody, Handler<AsyncResult<Void>> handler) { System.out.printf("sendOutputEvent called for %s, %s%n", connectionId, outputName); System.out.println(eventBody); Message msg = new Message(eventBody); msg.setOutputName(outputName); this.sendEventHelper(connectionId, msg, handler); }
@Override public void run() { clientArrayList.get(indexJ).sendEventAsync(new com.microsoft.azure.sdk.iot.device.Message(messageStates[indexI].messageBody), new FileUploadCallback(), messageStates[indexI]); } });
@Override public void run() { clientArrayList.get(indexJ).sendEventAsync(new com.microsoft.azure.sdk.iot.device.Message(messageStates[indexI].messageBody), new FileUploadCallback(), messageStates[indexI]); } });
@Override public void run() { deviceClient.sendEventAsync(new com.microsoft.azure.sdk.iot.device.Message(messageStates[index].messageBody), new FileUploadCallback(), messageStates[index]); } });
@Override public void run() { deviceClient.sendEventAsync(new com.microsoft.azure.sdk.iot.device.Message(messageStates[index].messageBody), new FileUploadCallback(), messageStates[index]); } });
@Override public void run() { deviceClient.sendEventAsync(new com.microsoft.azure.sdk.iot.device.Message(messageStates[index].messageBody), new FileUploadCallback(), messageStates[index]); } });
@Override public void run() { deviceClient.sendEventAsync(new com.microsoft.azure.sdk.iot.device.Message(messageStates[index].messageBody), new FileUploadCallback(), messageStates[index]); } });
@Override public void run() { deviceClient.sendEventAsync(new com.microsoft.azure.sdk.iot.device.Message(messageStates[index].messageBody), new FileUploadCallback(), messageStates[index]); } });
@Override public void run() { deviceClient.sendEventAsync(new com.microsoft.azure.sdk.iot.device.Message(messageStates[index].messageBody), new FileUploadCallback(), messageStates[index]); } });
@Override public void run() { deviceClient.sendEventAsync(new com.microsoft.azure.sdk.iot.device.Message(messageStates[index].messageBody), new FileUploadCallback(), messageStates[index]); } });
public static Message createMessageWithErrorInjectionProperties(String faultType, String reason, int delayInSecs, int durationInSecs) { String dataBuffer = UUID.randomUUID().toString(); Message message = new Message(dataBuffer); message.setProperty("AzIoTHub_FaultOperationType", faultType); message.setProperty("AzIoTHub_FaultOperationCloseReason", reason); message.setProperty("AzIoTHub_FaultOperationDelayInSecs", String.valueOf(delayInSecs)); message.setProperty("AzIoTHub_FaultOperationDurationInSecs", String.valueOf(durationInSecs)); return message; } }
@Override public void run() { deviceClient.sendEventAsync(new com.microsoft.azure.sdk.iot.device.Message(messageStates[index].messageBody), new FileUploadCallback(), messageStates[index]); } });
testInstance.client.sendEventAsync(new Message("some message body"), callback, messageSent);
private void sendMessages() throws Exception { for (int i = 0; i < numMessagesPerDevice; ++i) { Message msgSend = new Message(messageString); msgSend.setProperty("messageCount", Integer.toString(i)); for (int j = 0; j < numKeys; j++) { msgSend.setProperty("key"+j, "value"+j); } Success messageSent = new Success(); EventCallback callback = new EventCallback(IotHubStatusCode.OK_EMPTY); client.sendEventAsync(msgSend, callback, messageSent); long startTime = System.currentTimeMillis(); while(!messageSent.wasCallbackFired()) { Thread.sleep(RETRY_MILLISECONDS); if ((System.currentTimeMillis() - startTime) > sendTimeout) { fail(buildExceptionMessage("Timed out waiting for OK_EMPTY response for sent message", client)); } } if (messageSent.getCallbackStatusCode() != IotHubStatusCode.OK_EMPTY) { fail(buildExceptionMessage("Unexpected iot hub status code! Expected OK_EMPTY but got " + messageSent.getCallbackStatusCode(), client)); } } } }
Message msgSend = new Message(messageString); msgSend.setProperty("messageCount", Integer.toString(i)); for (int j = 0; j < numKeys; j++)
Message msg = new Message(messageString);
Message expiredMessage = new Message("This message has expired"); expiredMessage.setAbsoluteExpiryTime(1); //setting this to 0 causes the message to never expire Success messageSentExpiredCallback = new Success();
Message messageToSend = new Message("Test message expecting SAS Token Expired callback for protocol: " + protocol); Success messageSent = new Success(); Success statusUpdated = new Success();