Add config
This commit is contained in:
parent
2f4ac42edb
commit
a60e5cab2a
|
@ -31,6 +31,7 @@ import org.springframework.messaging.MessagingException;
|
|||
|
||||
public abstract class BaseSubscriptionDeliverySubscriber extends BaseSubscriptionSubscriber {
|
||||
private static final Logger ourLog = LoggerFactory.getLogger(BaseSubscriptionDeliverySubscriber.class);
|
||||
private boolean myReloadResourceBeforeDelivery = true;
|
||||
|
||||
public BaseSubscriptionDeliverySubscriber(IFhirResourceDao<?> theSubscriptionDao, Subscription.SubscriptionChannelType theChannelType, BaseSubscriptionInterceptor theSubscriptionInterceptor) {
|
||||
super(theSubscriptionDao, theChannelType, theSubscriptionInterceptor);
|
||||
|
@ -53,6 +54,7 @@ public abstract class BaseSubscriptionDeliverySubscriber extends BaseSubscriptio
|
|||
msg.setSubscription(updatedSubscription);
|
||||
}
|
||||
|
||||
if (myReloadResourceBeforeDelivery) {
|
||||
// Reload the payload just in case any interceptors modified
|
||||
// it before it was saved to the database. This is also
|
||||
// useful for resources created in a transaction, since they
|
||||
|
@ -62,6 +64,7 @@ public abstract class BaseSubscriptionDeliverySubscriber extends BaseSubscriptio
|
|||
IFhirResourceDao dao = getSubscriptionDao().getDao(type);
|
||||
IBaseResource loadedPayload = dao.read(payloadId);
|
||||
msg.setPayload(getContext(), loadedPayload);
|
||||
}
|
||||
|
||||
handleMessage(msg);
|
||||
} catch (Exception e) {
|
||||
|
@ -72,4 +75,8 @@ public abstract class BaseSubscriptionDeliverySubscriber extends BaseSubscriptio
|
|||
|
||||
public abstract void handleMessage(ResourceDeliveryMessage theMessage) throws Exception;
|
||||
|
||||
public void setReloadResourceBeforeDelivery(boolean theReloadResourceBeforeDelivery) {
|
||||
myReloadResourceBeforeDelivery = theReloadResourceBeforeDelivery;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue