This commit is contained in:
Ken Stevens 2019-02-13 16:54:38 -05:00
parent 68171ba950
commit 455761f9b3
1 changed files with 16 additions and 1 deletions

View File

@ -23,6 +23,7 @@ package ca.uhn.fhir.jpa.subscription.module.interceptor;
import ca.uhn.fhir.jpa.model.interceptor.api.Hook;
import ca.uhn.fhir.jpa.model.interceptor.api.Interceptor;
import ca.uhn.fhir.jpa.model.interceptor.api.Pointcut;
import ca.uhn.fhir.jpa.subscription.module.CanonicalSubscriptionChannelType;
import ca.uhn.fhir.jpa.subscription.module.ResourceModifiedMessage;
import ca.uhn.fhir.jpa.subscription.module.matcher.SubscriptionMatchResult;
import ca.uhn.fhir.jpa.subscription.module.subscriber.ResourceDeliveryMessage;
@ -118,7 +119,21 @@ public class SubscriptionDebugLogInterceptor {
@Hook(Pointcut.SUBSCRIPTION_AFTER_DELIVERY_FAILED)
public void step45_deliveryFailed(ResourceDeliveryMessage theMessage, Exception theFailure) {
log(EventCodeEnum.SUBS6, "Delivery of resource {} for subscription {} to channel of type {} - Failure: {}", theMessage.getPayloadId(), theMessage.getSubscription().getIdElementString(), theMessage.getSubscription().getChannelType(), theFailure.toString());
String payloadId = null;
String subscriptionId = null;
CanonicalSubscriptionChannelType channelType = null;
String failureString = null;
if (theMessage != null) {
payloadId = theMessage.getPayloadId();
if (theMessage.getSubscription() != null) {
subscriptionId = theMessage.getSubscription().getIdElementString();
channelType = theMessage.getSubscription().getChannelType();
}
}
if (theFailure != null) {
failureString = theFailure.toString();
}
log(EventCodeEnum.SUBS6, "Delivery of resource {} for subscription {} to channel of type {} - Failure: {}", payloadId, subscriptionId, channelType, failureString);
}
@Hook(Pointcut.SUBSCRIPTION_AFTER_DELIVERY)