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(); }); }
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); } }
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(); } }
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(); }); }
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(); }); }
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 }); }
public void Store(ScheduleMe scheduleMe) { throw new NotImplementedException(); }
public void OnMessage(ScheduleMe scheduleMe) { log.DebugWrite("Got Schedule Message"); scheduleRepository.Store(scheduleMe); }
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); }