@Override public void handleMessage(Message<?> theMessage) { if (!(theMessage.getPayload() instanceof ResourceDeliveryMessage)) { return; } try { ResourceDeliveryMessage msg = (ResourceDeliveryMessage) theMessage.getPayload(); if (myActiveSubscription.getSubscription().equals(msg.getSubscription())) { deliver(); } } catch (Exception e) { ourLog.error("Failure handling subscription payload", e); throw new MessagingException(theMessage, "Failure handling subscription payload", e); } }
@Override public void handleMessage(Message theMessage) throws MessagingException { if (!(theMessage.getPayload() instanceof ResourceDeliveryMessage)) { ourLog.warn("Unexpected payload type: {}", theMessage.getPayload()); return; } String subscriptionId = "(unknown?)"; try { ResourceDeliveryMessage msg = (ResourceDeliveryMessage) theMessage.getPayload(); subscriptionId = msg.getSubscription().getIdElement(myFhirContext).getValue(); ActiveSubscription updatedSubscription = mySubscriptionRegistry.get(msg.getSubscription().getIdElement(myFhirContext).getIdPart()); if (updatedSubscription != null) { msg.setSubscription(updatedSubscription.getSubscription()); } handleMessage(msg); } catch (Exception e) { String msg = "Failure handling subscription payload for subscription: " + subscriptionId; ourLog.error(msg, e); throw new MessagingException(theMessage, msg, e); } }
SubscriptionMatchResult matchResult = mySubscriptionMatcher.match(nextActiveSubscription.getSubscription(), theMsg); if (!matchResult.matched()) { continue; nextActiveSubscription.getSubscription().getIdElement(myFhirContext).getValue(), resourceId.toUnqualifiedVersionless().getValue(), matchResult.isInMemory() ? "in-memory" : "by querying the repository"); deliveryMsg.setSubscription(nextActiveSubscription.getSubscription()); deliveryMsg.setOperationType(theMsg.getOperationType()); if (payload == null) {