Exemple #1
0
        internal ClientEntity()
        {
            this.thisLock       = new object();
            this.exceptionQueue = new Lazy <Queue <Exception> >();
            CultureInfo invariantCulture = CultureInfo.InvariantCulture;

            object[] name = new object[] { this.GetType().Name, this.GetHashCode() };
            this.traceId     = string.Format(invariantCulture, "{0}/{1}", name);
            this.retryPolicy = Microsoft.ServiceBus.RetryPolicy.Default;
        }
Exemple #2
0
 public SbmpBrowsableMessageSession(string path, string sessionId, MessagingEntityType entityType, SbmpMessagingFactory messagingFactory, Microsoft.ServiceBus.RetryPolicy retryPolicy) : base(ReceiveMode.PeekLock, sessionId, DateTime.MinValue, messagingFactory, retryPolicy)
 {
     this.path       = path;
     this.entityType = entityType;
     this.resetEvent = new AutoResetEvent(true);
 }
Exemple #3
0
 private AmqpMessageReceiver(AmqpMessagingFactory messagingFactory, string entityName, MessagingEntityType?entityType, string sessionId, bool sessionReceiver, Microsoft.ServiceBus.RetryPolicy retryPolicy, ReceiveMode receiveMode, Microsoft.ServiceBus.Messaging.Filter filter) : base(messagingFactory, retryPolicy, receiveMode, filter)
 {
     this.receiveLink        = new FaultTolerantObject <ReceivingAmqpLink>(this, new Action <ReceivingAmqpLink>(this.CloseLink), new Func <TimeSpan, AsyncCallback, object, IAsyncResult>(this.BeginCreateLink), new Func <IAsyncResult, ReceivingAmqpLink>(this.EndCreateLink));
     this.messagingFactory   = messagingFactory;
     this.entityName         = entityName;
     this.EntityType         = entityType;
     this.sessionId          = sessionId;
     this.sessionReceiver    = sessionReceiver;
     this.PrefetchCount      = this.messagingFactory.PrefetchCount;
     this.lockedMessages     = new ConcurrentDictionary <Guid, ArraySegment <byte> >();
     this.clientLinkManager  = new ActiveClientLinkManager(this.messagingFactory);
     this.batchFlushInterval = this.messagingFactory.TransportSettings.BatchFlushInterval;
 }
Exemple #4
0
 public AmqpMessageReceiver(AmqpMessagingFactory messagingFactory, string entityName, MessagingEntityType?entityType, string sessionId, Microsoft.ServiceBus.RetryPolicy retryPolicy, ReceiveMode receiveMode) : this(messagingFactory, entityName, entityType, sessionId, true, retryPolicy, receiveMode, null)
 {
 }
Exemple #5
0
 public AmqpMessageReceiver(AmqpMessagingFactory messagingFactory, string entityName, MessagingEntityType?entityType, Microsoft.ServiceBus.RetryPolicy retryPolicy, ReceiveMode receiveMode, Microsoft.ServiceBus.Messaging.Filter filter) : this(messagingFactory, entityName, entityType, null, false, retryPolicy, receiveMode, filter)
 {
 }
Exemple #6
0
 public SbmpMessageSender(string path, Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessagingFactory messagingFactory, SbmpMessageCreator messageCreator, Microsoft.ServiceBus.RetryPolicy retryPolicy) : base(messagingFactory, retryPolicy)
 {
     this.SbmpMessagingFactory = messagingFactory;
     this.path           = path;
     this.MessageCreator = messageCreator;
     this.ViaSender      = !string.IsNullOrWhiteSpace(messageCreator.LinkInfo.TransferDestinationEntityAddress);
     this.BatchManager   = new BatchManager <BrokeredMessage>((TrackingContext trackingContext, IEnumerable <BrokeredMessage> messages, string transactionId, TimeSpan timeout, AsyncCallback callback, object state) => this.BeginSendCommand(trackingContext, messages, timeout, callback, state), (IAsyncResult result, bool forceCleanUp) => this.EndSendCommand(result), null, new OnRetryDelegate <BrokeredMessage>(SbmpMessageSender.IsSendCommandRetryable), null, null, (long)204800, (long)225280, this.GetOverheadSize())
     {
         FlushInterval = this.SbmpMessagingFactory.Settings.BatchFlushInterval
     };
     if (!this.SbmpMessagingFactory.Settings.GatewayMode && (this.SbmpMessagingFactory.Settings.GatewayMode || !this.SbmpMessagingFactory.Settings.EnableRedirect))
     {
         this.ShouldAddPartitioningHeaders = true;
         return;
     }
     this.BatchManager.CalculateBatchSize = new CalculateBatchSizeDelegate <BrokeredMessage>(SbmpMessageSender.DefaultCalculateSizeOfMessages);
     this.SbmpSenderBatchingEnabled       = true;
     this.ShouldAddPartitioningHeaders    = false;
 }
Exemple #7
0
 public SbmpMessageBrowser(string path, Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessagingFactory messagingFactory, SbmpMessageCreator messageCreator, Lazy <SbmpMessageCreator> controlMessageCreator, Microsoft.ServiceBus.RetryPolicy retryPolicy, bool embedParentLinkId) : base(messagingFactory, retryPolicy)
 {
     this.SbmpMessagingFactory = messagingFactory;
     this.path                    = path;
     this.MessageCreator          = messageCreator;
     this.ControlMessageCreator   = controlMessageCreator;
     base.InstanceTrackingContext = TrackingContext.GetInstance(Guid.NewGuid(), this.path);
 }
Exemple #8
0
 internal MessageSession(ReceiveMode receiveMode, string sessionId, DateTime lockedUntilUtc, Microsoft.ServiceBus.Messaging.MessagingFactory messagingFactory, Microsoft.ServiceBus.RetryPolicy retryPolicy) : base(messagingFactory, retryPolicy, receiveMode, null)
 {
     this.SessionId      = sessionId;
     this.LockedUntilUtc = lockedUntilUtc;
 }
 protected VolatileTopicClient(Microsoft.ServiceBus.Messaging.MessagingFactory messagingFactory, string path, string clientId, Microsoft.ServiceBus.RetryPolicy retryPolicy, Microsoft.ServiceBus.Messaging.Filter filter)
 {
     this.MessagingFactory    = messagingFactory;
     base.ClientEntityManager = new MessageClientEntityManager();
     this.openOnceManager     = new OpenOnceManager(this);
     this.Path        = path;
     this.ClientId    = (string.IsNullOrEmpty(clientId) ? Guid.NewGuid().ToString() : clientId);
     base.RetryPolicy = retryPolicy;
     this.Filter      = filter;
 }
 internal MessageBrowser(Microsoft.ServiceBus.Messaging.MessagingFactory messagingFactory, Microsoft.ServiceBus.RetryPolicy retryPolicy)
 {
     this.MessagingFactory         = messagingFactory;
     this.operationTimeout         = messagingFactory.OperationTimeout;
     this.lastPeekedSequenceNumber = Constants.DefaultLastPeekedSequenceNumber;
     base.RetryPolicy     = retryPolicy ?? messagingFactory.RetryPolicy.Clone();
     this.openOnceManager = new OpenOnceManager(this);
 }
 public SbmpVolatileTopicClient(SbmpMessagingFactory factory, string path, string clientId, Microsoft.ServiceBus.RetryPolicy retryPolicy, Microsoft.ServiceBus.Messaging.Filter filter) : base(factory, path, clientId, retryPolicy, filter)
 {
     this.ControlMessageCreator = new Lazy <SbmpMessageCreator>(new Func <SbmpMessageCreator>(this.InitializeControlLink));
 }
Exemple #12
0
 public AmqpVolatileTopicClient(AmqpMessagingFactory factory, string path, string clientId, Microsoft.ServiceBus.RetryPolicy retryPolicy, Microsoft.ServiceBus.Messaging.Filter filter) : base(factory, path, clientId, retryPolicy, filter)
 {
     this.messagingFactory = factory;
 }
 public AmqpMessageSender(AmqpMessagingFactory factory, string entityName, MessagingEntityType?entityType, Microsoft.ServiceBus.RetryPolicy retryPolicy) : base(factory, retryPolicy)
 {
     this.sendLink           = new FaultTolerantObject <SendingAmqpLink>(this, new Action <SendingAmqpLink>(this.CloseLink), new Func <TimeSpan, AsyncCallback, object, IAsyncResult>(this.BeginCreateLink), new Func <IAsyncResult, SendingAmqpLink>(this.EndCreateLink));
     this.messagingFactory   = factory;
     this.entityName         = entityName;
     this.EntityType         = entityType;
     this.clientLinkManager  = new ActiveClientLinkManager(this.messagingFactory);
     this.batchFlushInterval = this.messagingFactory.TransportSettings.BatchFlushInterval;
 }