Exemplo n.º 1
0
        public RabbitMessageBus(IDependencyResolver resolver, RabbitScaleoutConfiguration configuration)
            : base(resolver, configuration)
        {
            _bus = new RabbitMQBus(c => c.UseConnectionString(configuration.ConnectionString));

            ScaleoutMessageSerializer serializer = new ScaleoutMessageSerializer();

            _publisher  = _bus.CreatePublisher(c => c.UseCustomSerializer(serializer));
            _subscriber = _bus.CreateSubscriber(c => c.SetReceiveSelfPublish().AddCustomSerializer(serializer));

            _subscriber.Subscribe <ScaleoutMessage>(OnMessage, filter: configuration.FilterHeaders);

            Open(0);

            _subscriber.Open();
        }
Exemplo n.º 2
0
        public RabbitMessageBus(IDependencyResolver resolver, RabbitScaleoutConfiguration configuration)
            : base(resolver, configuration)
        {
            _bus = new RabbitMQBus(c => c.UseConnectionString(configuration.ConnectionString));

            ScaleoutMessageSerializer serializer = new ScaleoutMessageSerializer();

            _publisher = _bus.CreatePublisher(c => c.UseCustomSerializer(serializer));
            _subscriber = _bus.CreateSubscriber(c => c.SetReceiveSelfPublish().AddCustomSerializer(serializer));

            _subscriber.Subscribe<ScaleoutMessage>(OnMessage, filter: configuration.FilterHeaders);

            Open(0);

            _subscriber.Open();
        }