コード例 #1
0
 public void Publish(IProducerAttributes attributes)
 {
     this.channelForEventing.BasicPublish(
         attributes.GetExchangeName(),
         attributes.GetRoutingKey(),
         this.channelForEventing.CreateBasicProperties(),
         attributes.GetMessageBody()
         );
 }
コード例 #2
0
        public bool Create()
        {
            string routingKey = "CreateKardexEntryEvent";
            CreateKardexEntryEventJson jsonObject = this.CreateJsonObject(routingKey);

            // Add to the EventStore
            bool stored = RepositoryFactory <CreateKardexEntryEventJson> .Create().Append(jsonObject);

            // Publish to RabbitMQ
            if (stored)
            {
                jsonObject.Event = null;

                IProducerAttributes attributes = ProducerAttributesFactory <CreateKardexEntryEventJson> .Create(routingKey, jsonObject);

                EventBusQueueProducer producer = new EventBusQueueProducer();
                producer.Publish(attributes);
            }

            return(stored);
        }