Пример #1
0
        public void Store(ScheduleMe scheduleMe)
        {
            WithStoredProcedureCommand(dialect.InsertProcedureName, command =>
            {
                AddParameter(command, dialect.WakeTimeParameterName, scheduleMe.WakeTime, DbType.DateTime);
                AddParameter(command, dialect.BindingKeyParameterName, scheduleMe.BindingKey, DbType.String);
                AddParameter(command, dialect.CancellationKeyParameterName, scheduleMe.CancellationKey, DbType.String);
                AddParameter(command, dialect.MessageParameterName, scheduleMe.InnerMessage, DbType.Binary);

                command.ExecuteNonQuery();
            });
        }
Пример #2
0
 public void OnMessage(ScheduleMe scheduleMe)
 {
     try
     {
         log.DebugWrite("Got Schedule Message");
         scheduleRepository.Store(scheduleMe);
     }
     catch (Exception exception)
     {
         log.ErrorWrite("Error receiving message from queue", exception);
     }
 }
Пример #3
0
        public void Store(ScheduleMe scheduleMe)
        {
            using(var connection = new SqlConnection(connectionString))
            using (var command = new SqlCommand(insertSql, connection))
            {
                command.Parameters.AddWithValue("@WakeTime", scheduleMe.WakeTime);
                command.Parameters.AddWithValue("@BindingKey", scheduleMe.BindingKey);
                command.Parameters.AddWithValue("@InnerMessage", scheduleMe.InnerMessage);

                connection.Open();
                command.ExecuteNonQuery();
            }
        }
Пример #4
0
        public void Store(ScheduleMe scheduleMe)
        {
            WithStoredProcedureCommand(dialect.InsertProcedureName, command =>
            {
                AddParameter(command, dialect.WakeTimeParameterName, scheduleMe.WakeTime, DbType.DateTime);
                AddParameter(command, dialect.BindingKeyParameterName, scheduleMe.BindingKey, DbType.String);
                AddParameter(command, dialect.CancellationKeyParameterName, scheduleMe.CancellationKey, DbType.String);
                AddParameter(command, dialect.MessageParameterName, scheduleMe.InnerMessage, DbType.Binary);
                AddParameter(command, dialect.ExchangeParameterName, scheduleMe.Exchange, DbType.String);
                AddParameter(command, dialect.ExchangeTypeParameterName, scheduleMe.ExchangeType, DbType.String);
                AddParameter(command, dialect.RoutingKeyParameterName, scheduleMe.RoutingKey, DbType.String);
                AddParameter(command, dialect.MessagePropertiesParameterName, SerializeToString(scheduleMe.MessageProperties), DbType.String);
                AddParameter(command, dialect.InstanceNameParameterName, configuration.InstanceName, DbType.String);

                command.ExecuteNonQuery();
            });
        }
Пример #5
0
 public void OnMessage(ScheduleMe scheduleMe)
 {
     Console.WriteLine("Got Schedule Message");
     scheduleRepository.Store(scheduleMe);
 }
        /// <summary>
        /// SystemMessage scheduling parameters.
        /// Store schedule in SQL Server
        /// </summary>
        /// <param name="scheduleMe"></param>
        public void Store(ScheduleMe scheduleMe)
        {
            WithStoredProcedureCommand(insertSql, command =>
            {
                command.Parameters.AddWithValue("@WakeTime", scheduleMe.WakeTime);
                command.Parameters.AddWithValue("@BindingKey", scheduleMe.BindingKey);
                command.Parameters.AddWithValue("@Message", scheduleMe.InnerMessage);

                command.ExecuteNonQuery();
            });
        }
Пример #7
0
 private void OnMessage(ScheduleMe message)
 {
     log.DebugWrite("Got Schedule Message");
     scheduleRepository.Store(new Schedule
     {
         Id = Guid.NewGuid(),
         CancellationKey = message.CancellationKey,
         BindingKey = message.BindingKey,
         InnerMessage = message.InnerMessage,
         State = ScheduleState.Pending,
         WakeTime = message.WakeTime,
         Exchange = message.Exchange,
         ExchangeType = message.ExchangeType,
         RoutingKey = message.RoutingKey,
         BasicProperties = message.MessageProperties
     });
 }
Пример #8
0
 public void Store(ScheduleMe scheduleMe)
 {
     throw new NotImplementedException();
 }
Пример #9
0
 public void OnMessage(ScheduleMe scheduleMe)
 {
     log.DebugWrite("Got Schedule Message");
     scheduleRepository.Store(scheduleMe);
 }
Пример #10
0
 private void OnMessage(ScheduleMe message)
 {
     log.DebugWrite("Got Schedule Message");
     scheduleRepository.Store(new Schedule
         {
             Id = Guid.NewGuid(),
             CancellationKey = message.CancellationKey,
             BindingKey = message.BindingKey,
             InnerMessage = message.InnerMessage,
             State = ScheduleState.Pending,
             WakeTime = message.WakeTime
         });
 }
 public void OnMessage(ScheduleMe msgIn)
 {
     log.DebugWrite("[1020] Scheduler:Got({0}) Schedule Message",msgIn.BindingKey);
     scheduleRepository.Store(msgIn);
 }