public OldestNonAckedMessageUpdaterPeriodicAction(IBus bus, IPeerStateRepository peerStateRepository, PersistenceCqlDataContext dataContext, ICqlPersistenceConfiguration configuration)
     : base(bus, configuration.OldestMessagePerPeerCheckPeriod)
 {
     _peerStateRepository = peerStateRepository;
     _dataContext         = dataContext;
     _configuration       = configuration;
 }
示例#2
0
        public CqlStorage(PersistenceCqlDataContext dataContext, IPersistenceConfiguration configuration, IReporter reporter)
        {
            _dataContext         = dataContext;
            _peerStateRepository = new PeerStateRepository(dataContext);
            _configuration       = configuration;
            _reporter            = reporter;

            _preparedStatement = dataContext.Session.Prepare(dataContext.PersistentMessages.Insert(new PersistentMessage()).SetTTL(0).SetTimestamp(default(DateTimeOffset)).ToString());
        }
示例#3
0
        public CqlStorage(PersistenceCqlDataContext dataContext, IPeerStateRepository peerStateRepository, IPersistenceConfiguration configuration, IReporter reporter)
        {
            _dataContext         = dataContext;
            _peerStateRepository = peerStateRepository;
            _configuration       = configuration;
            _reporter            = reporter;

            _preparedStatement = dataContext.Session.Prepare(dataContext.PersistentMessages.Insert(new PersistentMessage()).SetTTL(0).SetTimestamp(default(DateTimeOffset)).ToString());
            _parallelPersistor = new ParallelPersistor(dataContext.Session, 64, ex => _log.Warn("Exception caught while trying to persist message", ex));
        }
示例#4
0
 public CqlMessageReader(PersistenceCqlDataContext dataContext, PeerState peerState)
 {
     _dataContext       = dataContext;
     _peerState         = peerState;
     _preparedStatement = _dataContext.Session.Prepare(_dataContext.PersistentMessages
                                                       .Where(x => x.PeerId == _peerState.PeerId.ToString() &&
                                                              x.BucketId == 0 &&
                                                              x.UniqueTimestampInTicks >= 0)
                                                       .Select(x => new { x.IsAcked, x.TransportMessage })
                                                       .ToString());
 }
示例#5
0
 public PeerStateRepository(PersistenceCqlDataContext dataContext)
 {
     _dataContext = dataContext;
 }