Beispiel #1
0
        private static void TestSbSingle()
        {
            var bus     = ServiceBusFactory.GetServiceBus();
            var eventId = new Guid("cf0a200c-e6d3-472e-8c2c-286b2032ba6e");

            const string EventType = "ITOperations.Mating.HeatEvent";

            var          validationResult   = new EventValidator("Animal", "animalIdentity").GetValidationResult(eventId);
            const string ValidatorQueueName = "EventProcessing.ValidationAggregator.service.input";

            using (var ts = new TransactionScope())
            {
                bus.Send(ValidatorQueueName,
                         new ValidationResult
                {
                    EventID = eventId,
                    EventServiceBoundary = AIWebAPI.ResourceLocator.ServiceName,
                    EventSource          = AnimalIdentityServiceEventSources.MindaPro,
                    ValidationOutcome    = ValidationResultFlag.Valid,
                    EventType            = EventType
                });

                bus.Send(ValidatorQueueName,
                         new ValidationResult
                {
                    EventID = eventId,
                    EventServiceBoundary = AIWebAPI.ResourceLocator.ServiceName,
                    EventSource          = AnimalIdentityServiceEventSources.MindaPro,
                    ValidationOutcome    = ValidationResultFlag.Valid,
                    EventType            = EventType
                });
                bus.Send(ValidatorQueueName,
                         new ValidationResult
                {
                    EventID = eventId,
                    EventServiceBoundary = "ITOperations.AnimalCharacteristic",
                    EventSource          = AnimalIdentityServiceEventSources.MindaPro,
                    ValidationOutcome    = ValidationResultFlag.Valid,
                    EventType            = EventType
                });

                bus.Send(ValidatorQueueName,
                         new ValidationResult
                {
                    EventID = eventId,
                    EventServiceBoundary = AIWebAPI.ResourceLocator.ServiceName,
                    EventSource          = AnimalIdentityServiceEventSources.MindaPro,
                    ValidationOutcome    = ValidationResultFlag.Valid,
                    EventType            = EventType
                });

                ts.Complete();
            }
        }
Beispiel #2
0
 public WriterQueueMsgSender()
 {
     _bus = ServiceBusFactory.GetServiceBus();
 }
Beispiel #3
0
 public AggQueueMsgSender()
 {
     _bus = ServiceBusFactory.GetServiceBus();
 }
 public ValidatorQueueMsgSender()
 {
     _bus = ServiceBusFactory.GetServiceBus();
 }
Beispiel #5
0
 public ReceiverQueueMsgSender()
 {
     _bus = ServiceBusFactory.GetServiceBus();
 }
Beispiel #6
0
        private static void TestSbParallel()
        {
            var bus     = ServiceBusFactory.GetServiceBus();
            var addDays = new List <int>();

            Debug.Print(DateTime.Now.ToString());

            for (var i = 119; i <= 119; i++)
            {
                addDays.Add(i);
            }


            Parallel.ForEach(addDays, addDay =>
            {
                Debug.Print(Guid.NewGuid().ToString());

                bus.Send(ConfigurationManager.AppSettings["CalendarServiceQueue"].GoToTestServer(), new SubmitEventToHoldingPen
                {
                    EventId             = Guid.NewGuid(),
                    EventDate           = DateTime.Now,
                    EventType           = AGMWebAPI.ResourceLocator.ServiceName,
                    AnimalGroupBpNumber = "",
                    Source   = "MindaPro",
                    SourceId = ""
                });

                bus.Send(ConfigurationManager.AppSettings["AnimalGroupMembershipServiceQueue"].GoToTestServer(), new AGM.SubmitAnimalEvent
                {
                    EventId             = Guid.NewGuid(),
                    Date                = DateTime.Now,
                    AnimalKey           = 123456,
                    AnimalGroupBpNumber = "",
                    EventType           = AGMWebAPI.ResourceLocator.ServiceName
                });

                bus.Send(ConfigurationManager.AppSettings["AnimalIdentityServiceQueue"].GoToTestServer(), new AI.SubmitAnimalEvent
                {
                    EventId   = Guid.NewGuid(),
                    Date      = DateTime.Now,
                    AnimalKey = 123456,
                    EventType = AIWebAPI.ResourceLocator.ServiceName
                });

                bus.Send(ConfigurationManager.AppSettings["AnimalCharacteristicServiceQueue"].GoToTestServer(), new AC.SubmitAnimalEvent
                {
                    EventId   = Guid.NewGuid(),
                    Date      = DateTime.Now,
                    AnimalKey = 123456,
                    EventType = AIWebAPI.ResourceLocator.ServiceName
                });

                bus.Send(ConfigurationManager.AppSettings["MatingServiceQueue"].GoToTestServer(), new Mating.SubmitHeatEvent
                {
                    EventId   = Guid.NewGuid(),
                    Date      = DateTime.Now,
                    AnimalKey = 123456
                });
            }
                             );
        }