Example #1
0
        // Obtain the session on which the AMQP receiver link should be created and then delegate
        // to the ISubscriberLinker implementation associated with the host item (Queue/Topic).
        // The subscriber-linker will bind the message handler to the host item so it will be
        // invoked when a message is received.
        private void LinkSubscriber(HostItemSubscriber subscriber, ISubscriptionSettings subscriptionSettings)
        {
            Session           session = ConnectionModule.CreateReceiverSession(subscriber.HostAttribute.HostName);
            ISubscriberLinker linker  = subscriber.HostItemAttribute.Linker;

            linker.SetServices(DispatchModule, _serialization, Context.LoggerFactory);

            // Delegate to the subscriber linker implementation to handle received messages:
            linker.LinkSubscriber(session, subscriber, subscriptionSettings);
        }
Example #2
0
 protected HostItemAttribute(ISubscriberLinker linker)
 {
     Linker = linker ?? throw new ArgumentNullException(nameof(linker));
 }