public void Publish(IProducerAttributes attributes) { this.channelForEventing.BasicPublish( attributes.GetExchangeName(), attributes.GetRoutingKey(), this.channelForEventing.CreateBasicProperties(), attributes.GetMessageBody() ); }
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); }