/** * Settles the command message with the <em>accepted</em> outcome. * <p> * This method simply invokes {@link CommandContext#accept(int)} with * 0 credits. */ public void accept() { accept(0); }
private void afterCommandPublished(final CommandSubscription subscription, final CommandContext commandContext) { metrics.incrementCommandDeliveredToDevice(subscription.getTenant()); LOG.debug("Published command to device [tenant-id: {}, device-id: {}, MQTT client-id: {}, QoS: {}]", subscription.getTenant(), subscription.getDeviceId(), subscription.getClientId(), subscription.getQos()); final Map<String, String> items = new HashMap<>(4); items.put(Fields.EVENT, "Published command to device"); items.put(Tags.MESSAGE_BUS_DESTINATION.getKey(), subscription.getTopic()); items.put(TracingHelper.TAG_CLIENT_ID.getKey(), subscription.getClientId()); items.put(TracingHelper.TAG_QOS.getKey(), subscription.getQos().toString()); commandContext.getCurrentSpan().log(items); commandContext.accept(1); }
logItems.put(Fields.EVENT, "device accepted command"); commandContext.getCurrentSpan().log(logItems); commandContext.accept(1); } else if (Rejected.class.isInstance(remoteState)) { final ErrorCondition error = ((Rejected) remoteState).getError();
items.put(TracingHelper.TAG_QOS.getKey(), qos.toString()); commandContext.getCurrentSpan().log(items); commandContext.accept(1);
if (commandContext != null) { commandContext.getCurrentSpan().log("forwarded command to device in HTTP response body"); commandContext.accept(); metrics.incrementCommandDeliveredToDevice(tenant);
if (commandContext != null) { commandContext.getCurrentSpan().log("forwarded command to device in HTTP response body"); commandContext.accept(); metrics.incrementCommandDeliveredToDevice(tenant);