public QueueActions(Session session, JET_DBID dbid, string queueName, string[] subqueues, AbstractActions actions, Action <int> changeNumberOfMessages) { _queueName = queueName; _subqueues = subqueues; _actions = actions; _changeNumberOfMessages = changeNumberOfMessages; var msgs = new Table(session, dbid, queueName, OpenTableGrbit.None); var msgsHistory = new Table(session, dbid, queueName + "_history", OpenTableGrbit.None); _messages = new EsentTable(session, msgs); _messageHistory = new EsentTable(session, msgsHistory); }
internal static TMessage ReadMessage <TMessage>(this EsentTable table, MessageBookmark bookmark, string queueName, Action <TMessage> action) where TMessage : PersistentMessage, new() { var message = new TMessage { Bookmark = bookmark, Status = (MessageStatus)table.ForColumnType <IntColumn>().Get("status"), Headers = HttpUtility.ParseQueryString(table.ForColumnType <StringColumn>().Get("headers")), Queue = queueName, SentAt = table.ForColumnType <DateTimeColumn>().Get("timestamp"), Data = table.ForColumnType <BytesColumn>().Get("data"), }; action(message); return(message); }