public void start() { if (myProcessingChannel == null) { myProcessingChannel = mySubscriptionChannelFactory.newMatchingChannel(SUBSCRIPTION_MATCHING_CHANNEL_NAME); } myProcessingChannel.subscribe(mySubscriptionMatchingSubscriber); ourLog.info("Subscription Matching Subscriber subscribed to Matching Channel {} with name {}", myProcessingChannel.getClass().getName(), SUBSCRIPTION_MATCHING_CHANNEL_NAME); }
@SuppressWarnings("UnusedReturnValue") private CanonicalSubscription registerSubscription(IIdType theId, IBaseResource theSubscription) { Validate.notNull(theId); String subscriptionId = theId.getIdPart(); Validate.notBlank(subscriptionId); Validate.notNull(theSubscription); CanonicalSubscription canonicalized = mySubscriptionCanonicalizer.canonicalize(theSubscription); SubscribableChannel deliveryChannel; Optional<MessageHandler> deliveryHandler; if (myModelConfig.isSubscriptionMatchingEnabled()) { deliveryChannel = mySubscriptionDeliveryChannelFactory.newDeliveryChannel(subscriptionId, canonicalized.getChannelType().toCode().toLowerCase()); deliveryHandler = mySubscriptionDeliveryHandlerFactory.createDeliveryHandler(canonicalized); } else { deliveryChannel = null; deliveryHandler = Optional.empty(); } ActiveSubscription activeSubscription = new ActiveSubscription(canonicalized, deliveryChannel); deliveryHandler.ifPresent(activeSubscription::register); myActiveSubscriptionCache.put(subscriptionId, activeSubscription); // Interceptor call: SUBSCRIPTION_AFTER_ACTIVE_SUBSCRIPTION_REGISTERED myInterceptorBroadcaster.callHooks(Pointcut.SUBSCRIPTION_AFTER_ACTIVE_SUBSCRIPTION_REGISTERED, canonicalized); return canonicalized; }
public void start() { if (myProcessingChannel == null) { myProcessingChannel = mySubscriptionChannelFactory.newMatchingChannel(SUBSCRIPTION_MATCHING_CHANNEL_NAME); } myProcessingChannel.subscribe(mySubscriptionMatchingSubscriber); ourLog.info("Subscription Matching Subscriber subscribed to Matching Channel {} with name {}", myProcessingChannel.getClass().getName(), SUBSCRIPTION_MATCHING_CHANNEL_NAME); }