public ApplicationMessageSubscriber(
     IMessageQueueConsumerFactory queueConsumerFactory,
     IMessageSubscriptionManager subscriptionManager,
     IApplicationMessageProcessor processor,
     ILogger <ApplicationMessageSubscriber> logger,
     VoguediOptions options)
     : base(queueConsumerFactory, subscriptionManager, processor, logger, options.DefaultApplicationMessageGroupName, options.DefaultApplicationTopicQueueCount)
 {
 }
Ejemplo n.º 2
0
 public CommandSubscriber(
     IMessageQueueConsumerFactory queueConsumerFactory,
     IMessageSubscriptionManager subscriptionManager,
     ICommandProcessor processor,
     ILogger <CommandSubscriber> logger,
     VoguediOptions options)
     : base(queueConsumerFactory, subscriptionManager, processor, logger, options.DefaultCommandGroupName, options.DefaultCommandTopicQueueCount)
 {
 }
Ejemplo n.º 3
0
 public EventSubscriber(
     IMessageQueueConsumerFactory queueConsumerFactory,
     IMessageSubscriptionManager subscriptionManager,
     IEventProcessor processor,
     ILogger <EventSubscriber> logger,
     VoguediOptions options)
     : base(queueConsumerFactory, subscriptionManager, processor, logger, options.DefaultEventGroupName, options.DefaultEventTopicQueueCount)
 {
 }
        public static void SubscribeHandlerForEvents <TEntity, THandler>(this IMessageSubscriptionManager subscriptionManager, string exchange, string entityTypeName)
            where THandler : IEntityEventsHandler <TEntity>
        {
            subscriptionManager.RegisterBinding <EntityCreated <TEntity> >(exchange, $"{entityTypeName}:EntityCreated");
            subscriptionManager.RegisterBinding <EntityUpdated <TEntity> >(exchange, $"{entityTypeName}:EntityUpdated");
            subscriptionManager.RegisterBinding <EntityDeleted <TEntity> >(exchange, $"{entityTypeName}:EntityDeleted");

            subscriptionManager.Subscribe <EntityCreated <TEntity>, THandler>();
            subscriptionManager.Subscribe <EntityUpdated <TEntity>, THandler>();
            subscriptionManager.Subscribe <EntityDeleted <TEntity>, THandler>();
        }
Ejemplo n.º 5
0
 protected MessageSubscriber(
     IMessageQueueConsumerFactory consumerFactory,
     IMessageSubscriptionManager subscriptionManager,
     IMessageProcessor processor,
     ILogger logger,
     string defaultGroupName,
     int defaultTopicQueueCount)
 {
     this.queueConsumerFactory = consumerFactory;
     this.subscriptionManager  = subscriptionManager;
     this.processor            = processor;
     this.logger                 = logger;
     this.defaultGroupName       = defaultGroupName;
     this.defaultTopicQueueCount = defaultTopicQueueCount;
     timeout = TimeSpan.FromSeconds(1);
     cancellationTokenSource = new CancellationTokenSource();
 }
 public static void SubscribeForEvents <TEntity, TEvent>(this IMessageSubscriptionManager subscriptionManager, string exchange, string eventName)
 {
     SubscribeHandlerForEvents <TEvent, EntityEventsHandler <TEntity, TEvent> >(subscriptionManager, exchange, eventName);
 }
 public static void SubscribeHandlerForEvents <TEntity, THandler>(this IMessageSubscriptionManager subscriptionManager, string exchange)
     where THandler : IEntityEventsHandler <TEntity>
 {
     SubscribeHandlerForEvents <TEntity, THandler>(subscriptionManager, exchange, typeof(TEntity).Name);
 }
Ejemplo n.º 8
0
 public MessagePublisher(IMessageQueueProducer queueProducer, IMessageSubscriptionManager subscriptionManager, IStringObjectSerializer objectSerializer)
 {
     this.queueProducer       = queueProducer;
     this.subscriptionManager = subscriptionManager;
     this.objectSerializer    = objectSerializer;
 }