コード例 #1
0
        public MartenEnvelopeTransaction(IDocumentSession session, IMessageContext bus)
        {
            if (!(bus.Advanced.Factory is MartenBackedDurableMessagingFactory))
            {
                throw new InvalidOperationException("This Jasper application is not using Marten as the backing message persistence");
            }

            var martenPersistence = bus.Advanced.Factory.As <MartenBackedDurableMessagingFactory>();

            _nodeId  = martenPersistence.Settings.UniqueNodeId;
            _tables  = martenPersistence.Tables;
            _session = session;
        }
コード例 #2
0
        public MartenEnvelopePersistor(IDocumentSession session, IServiceBus bus)
        {
            if (!(bus.Persistence is MartenBackedMessagePersistence))
            {
                throw new InvalidOperationException("This Jasper application is not using Marten as the backing message persistence");
            }

            var martenPersistence = bus.Persistence.As <MartenBackedMessagePersistence>();

            _nodeId  = martenPersistence.Settings.UniqueNodeId;
            _tables  = martenPersistence.Tables;
            _session = session;
        }