| | | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | | 2 | | // Licensed under the MIT License. |
| | | 3 | | |
| | | 4 | | using System; |
| | | 5 | | using System.Collections.Generic; |
| | | 6 | | using System.Diagnostics.Tracing; |
| | | 7 | | using System.Reflection; |
| | | 8 | | using System.Threading.Tasks; |
| | | 9 | | using Azure.Core.Diagnostics; |
| | | 10 | | using Azure.Messaging.ServiceBus.Amqp; |
| | | 11 | | using Azure.Messaging.ServiceBus.Primitives; |
| | | 12 | | using Microsoft.Azure.Amqp; |
| | | 13 | | |
| | | 14 | | namespace Azure.Messaging.ServiceBus.Diagnostics |
| | | 15 | | { |
| | | 16 | | /// <summary> |
| | | 17 | | /// Serves as an ETW event source for logging of information about |
| | | 18 | | /// Entitys client. |
| | | 19 | | /// </summary> |
| | | 20 | | /// |
| | | 21 | | /// <remarks> |
| | | 22 | | /// When defining Start/Stop tasks, it is highly recommended that the |
| | | 23 | | /// the StopEvent.Id must be exactly StartEvent.Id + 1. |
| | | 24 | | /// </remarks> |
| | | 25 | | [EventSource(Name = EventSourceName)] |
| | | 26 | | internal class ServiceBusEventSource : EventSource |
| | | 27 | | { |
| | | 28 | | /// <summary>The name to use for the event source.</summary> |
| | | 29 | | private const string EventSourceName = "Azure-Messaging-ServiceBus"; |
| | | 30 | | |
| | | 31 | | /// <summary> |
| | | 32 | | /// Provides a singleton instance of the event source for callers to |
| | | 33 | | /// use for logging. |
| | | 34 | | /// </summary> |
| | 404 | 35 | | public static ServiceBusEventSource Log { get; } = new ServiceBusEventSource(EventSourceName); |
| | | 36 | | |
| | | 37 | | /// <summary> |
| | | 38 | | /// Prevents an instance of the <see cref="ServiceBusEventSource"/> class from being |
| | | 39 | | /// created outside the scope of the <see cref="Log" /> instance, as well as setting up the |
| | | 40 | | /// integration with AzureEventSourceListenter. |
| | | 41 | | /// </summary> |
| | 2 | 42 | | private ServiceBusEventSource(string eventSourceName) : base(eventSourceName, EventSourceSettings.Default, Azure |
| | | 43 | | { |
| | 2 | 44 | | } |
| | | 45 | | |
| | | 46 | | // parameterless constructor for mocking |
| | 148 | 47 | | internal ServiceBusEventSource() { } |
| | | 48 | | |
| | | 49 | | #region event constants |
| | | 50 | | // event constants should not be changed |
| | | 51 | | internal const int SendMessageStartEvent = 1; |
| | | 52 | | internal const int SendMessageCompleteEvent = 2; |
| | | 53 | | internal const int SendMessageExceptionEvent = 3; |
| | | 54 | | |
| | | 55 | | internal const int CreateMessageBatchStartEvent = 4; |
| | | 56 | | internal const int CreateMessageBatchCompleteEvent = 5; |
| | | 57 | | internal const int CreateMessageBatchExceptionEvent = 6; |
| | | 58 | | |
| | | 59 | | internal const int ReceiveMessageStartEvent = 7; |
| | | 60 | | internal const int ReceiveMessageCompleteEvent = 8; |
| | | 61 | | internal const int ReceiveMessageExceptionEvent = 9; |
| | | 62 | | |
| | | 63 | | internal const int ScheduleMessageStartEvent = 10; |
| | | 64 | | internal const int ScheduleMessageCompleteEvent = 11; |
| | | 65 | | internal const int ScheduleMessageExceptionEvent = 12; |
| | | 66 | | |
| | | 67 | | internal const int CancelScheduledMessageStartEvent = 13; |
| | | 68 | | internal const int CancelScheduledMessageCompleteEvent = 14; |
| | | 69 | | internal const int CancelScheduledMessageExceptionEvent = 15; |
| | | 70 | | |
| | | 71 | | internal const int CompleteMessageStartEvent = 16; |
| | | 72 | | internal const int CompleteMessageCompleteEvent = 17; |
| | | 73 | | internal const int CompleteMessageExceptionEvent = 18; |
| | | 74 | | |
| | | 75 | | internal const int DeferMessageStartEvent = 19; |
| | | 76 | | internal const int DeferMessageCompleteEvent = 20; |
| | | 77 | | internal const int DeferMessageExceptionEvent = 21; |
| | | 78 | | |
| | | 79 | | internal const int AbandonMessageStartEvent = 22; |
| | | 80 | | internal const int AbandonMessageCompleteEvent = 23; |
| | | 81 | | internal const int AbandonMessageExceptionEvent = 24; |
| | | 82 | | |
| | | 83 | | internal const int DeadLetterMessageStartEvent = 25; |
| | | 84 | | internal const int DeadLetterMessageCompleteEvent = 26; |
| | | 85 | | internal const int DeadLetterMessageExceptionEvent = 27; |
| | | 86 | | |
| | | 87 | | internal const int PeekMessageStartEvent = 28; |
| | | 88 | | internal const int PeekMessageCompleteEvent = 29; |
| | | 89 | | internal const int PeekMessageExceptionEvent = 30; |
| | | 90 | | |
| | | 91 | | internal const int RenewMessageLockStartEvent = 31; |
| | | 92 | | internal const int RenewMessageLockCompleteEvent = 32; |
| | | 93 | | internal const int RenewMessageLockExceptionEvent = 33; |
| | | 94 | | |
| | | 95 | | internal const int ReceiveDeferredMessageStartEvent = 34; |
| | | 96 | | internal const int ReceiveDeferredMessageCompleteEvent = 35; |
| | | 97 | | internal const int ReceiveDeferredMessageExceptionEvent = 36; |
| | | 98 | | |
| | | 99 | | internal const int LinkStateLostEvent = 37; |
| | | 100 | | internal const int ReceiveLinkClosedEvent = 38; |
| | | 101 | | internal const int AmqpLinkRefreshStartEvent = 39; |
| | | 102 | | internal const int AmqpLinkRefreshCompleteEvent = 40; |
| | | 103 | | internal const int AmqpLinkRefreshExceptionEvent = 41; |
| | | 104 | | |
| | | 105 | | internal const int ManagementSerializedExceptionEvent = 42; |
| | | 106 | | internal const int RunOperationExceptionEvent = 43; |
| | | 107 | | |
| | | 108 | | internal const int ClientDisposeStartEvent = 44; |
| | | 109 | | internal const int ClientDisposeCompleteEvent = 45; |
| | | 110 | | internal const int ClientDisposeExceptionEvent = 46; |
| | | 111 | | |
| | | 112 | | internal const int RenewSessionLockStartEvent = 47; |
| | | 113 | | internal const int RenewSessionLockCompleteEvent = 48; |
| | | 114 | | internal const int RenewSessionLockExceptionEvent = 49; |
| | | 115 | | |
| | | 116 | | internal const int StartProcessingStartEvent = 50; |
| | | 117 | | internal const int StartProcessingCompleteEvent = 51; |
| | | 118 | | internal const int StartProcessingExceptionEvent = 52; |
| | | 119 | | |
| | | 120 | | internal const int StopProcessingStartEvent = 53; |
| | | 121 | | internal const int StopProcessingCompleteEvent = 54; |
| | | 122 | | internal const int StopProcessingExceptionEvent = 55; |
| | | 123 | | |
| | | 124 | | internal const int ProcessorRenewMessageLockStartEvent = 56; |
| | | 125 | | internal const int ProcessorRenewMessageLockCompleteEvent = 57; |
| | | 126 | | internal const int ProcessorRenewMessageLockExceptionEvent = 58; |
| | | 127 | | |
| | | 128 | | internal const int ProcessorRenewSessionLockStartEvent = 59; |
| | | 129 | | internal const int ProcessorRenewSessionLockCompleteEvent = 60; |
| | | 130 | | internal const int ProcessorRenewSessionLockExceptionEvent = 61; |
| | | 131 | | |
| | | 132 | | internal const int GetSessionStateStartEvent = 62; |
| | | 133 | | internal const int GetSessionStateCompleteEvent = 63; |
| | | 134 | | internal const int GetSessionStateExceptionEvent = 64; |
| | | 135 | | |
| | | 136 | | internal const int SetSessionStateStartEvent = 65; |
| | | 137 | | internal const int SetSessionStateCompleteEvent = 66; |
| | | 138 | | internal const int SetSessionStateExceptionEvent = 67; |
| | | 139 | | |
| | | 140 | | internal const int AddRuleStartEvent = 68; |
| | | 141 | | internal const int AddRuleCompleteEvent = 69; |
| | | 142 | | internal const int AddRuleExceptionEvent = 70; |
| | | 143 | | |
| | | 144 | | internal const int RemoveRuleStartEvent = 71; |
| | | 145 | | internal const int RemoveRuleCompleteEvent = 72; |
| | | 146 | | internal const int RemoveRuleExceptionEvent = 73; |
| | | 147 | | |
| | | 148 | | internal const int GetRuleStartEvent = 74; |
| | | 149 | | internal const int GetRuleCompleteEvent = 75; |
| | | 150 | | internal const int GetRuleExceptionEvent = 76; |
| | | 151 | | |
| | | 152 | | internal const int ClientCreateStartEvent = 77; |
| | | 153 | | internal const int ClientCreateCompleteEvent = 78; |
| | | 154 | | internal const int ClientCreateExceptionEvent = 79; |
| | | 155 | | |
| | | 156 | | internal const int CreateSendLinkStartEvent = 80; |
| | | 157 | | internal const int CreateSendLinkCompleteEvent = 81; |
| | | 158 | | internal const int CreateSendLinkExceptionEvent = 82; |
| | | 159 | | |
| | | 160 | | internal const int CreateReceiveLinkStartEvent = 83; |
| | | 161 | | internal const int CreateReceiveLinkCompleteEvent = 84; |
| | | 162 | | internal const int CreateReceiveLinkExceptionEvent = 85; |
| | | 163 | | |
| | | 164 | | internal const int CreateManagementLinkStartEvent = 86; |
| | | 165 | | internal const int CreateManagementLinkCompleteEvent = 87; |
| | | 166 | | internal const int CreateManagementLinkExceptionEvent = 88; |
| | | 167 | | |
| | | 168 | | internal const int TransactionInitializationExceptionEvent = 89; |
| | | 169 | | internal const int TransactionDeclaredEvent = 90; |
| | | 170 | | internal const int TransactionDischargedEvent = 91; |
| | | 171 | | internal const int TransactionDischargedExceptionEvent = 92; |
| | | 172 | | internal const int CreateControllerExceptionEvent = 93; |
| | | 173 | | |
| | | 174 | | internal const int ProcessorErrorHandlerThrewExceptionEvent = 94; |
| | | 175 | | internal const int ScheduleTaskFailedEvent = 95; |
| | | 176 | | |
| | | 177 | | internal const int PluginStartEvent = 96; |
| | | 178 | | internal const int PluginCompleteEvent = 97; |
| | | 179 | | internal const int PluginExceptionEvent = 98; |
| | | 180 | | |
| | | 181 | | internal const int MaxMessagesExceedsPrefetchEvent = 99; |
| | | 182 | | internal const int SendLinkClosedEvent = 100; |
| | | 183 | | internal const int ManagementLinkClosedEvent = 101; |
| | | 184 | | |
| | | 185 | | #endregion |
| | | 186 | | // add new event numbers here incrementing from previous |
| | | 187 | | |
| | | 188 | | #region Sending |
| | | 189 | | [Event(SendMessageStartEvent, Level = EventLevel.Informational, Message = "{0}: SendAsync start. MessageCount = |
| | | 190 | | public virtual void SendMessageStart(string identifier, int messageCount) |
| | | 191 | | { |
| | 2 | 192 | | if (IsEnabled()) |
| | | 193 | | { |
| | 0 | 194 | | WriteEvent(SendMessageStartEvent, identifier, messageCount); |
| | | 195 | | } |
| | 2 | 196 | | } |
| | | 197 | | |
| | | 198 | | [Event(SendMessageCompleteEvent, Level = EventLevel.Informational, Message = "{0}: SendAsync done.")] |
| | | 199 | | public virtual void SendMessageComplete(string identifier) |
| | | 200 | | { |
| | 2 | 201 | | if (IsEnabled()) |
| | | 202 | | { |
| | 0 | 203 | | WriteEvent(SendMessageCompleteEvent, identifier); |
| | | 204 | | } |
| | 2 | 205 | | } |
| | | 206 | | |
| | | 207 | | [Event(SendMessageExceptionEvent, Level = EventLevel.Error, Message = "{0}: SendAsync Exception: {1}.")] |
| | | 208 | | public virtual void SendMessageException(string identifier, string exception) |
| | | 209 | | { |
| | 0 | 210 | | if (IsEnabled()) |
| | | 211 | | { |
| | 0 | 212 | | WriteEvent(SendMessageExceptionEvent, identifier, exception); |
| | | 213 | | } |
| | 0 | 214 | | } |
| | | 215 | | |
| | | 216 | | [Event(CreateMessageBatchStartEvent, Level = EventLevel.Informational, Message = "{0}: CreateBatchAsync start.") |
| | | 217 | | public virtual void CreateMessageBatchStart(string identifier) |
| | | 218 | | { |
| | 0 | 219 | | if (IsEnabled()) |
| | | 220 | | { |
| | 0 | 221 | | WriteEvent(CreateMessageBatchStartEvent, identifier); |
| | | 222 | | } |
| | 0 | 223 | | } |
| | | 224 | | |
| | | 225 | | [Event(CreateMessageBatchCompleteEvent, Level = EventLevel.Informational, Message = "{0}: CreateBatchAsync done. |
| | | 226 | | public virtual void CreateMessageBatchComplete(string identifier) |
| | | 227 | | { |
| | 0 | 228 | | if (IsEnabled()) |
| | | 229 | | { |
| | 0 | 230 | | WriteEvent(CreateMessageBatchCompleteEvent, identifier); |
| | | 231 | | } |
| | 0 | 232 | | } |
| | | 233 | | |
| | | 234 | | [Event(CreateMessageBatchExceptionEvent, Level = EventLevel.Error, Message = "{0}: CreateBatchAsync Exception: { |
| | | 235 | | public virtual void CreateMessageBatchException(string identifier, string exception) |
| | | 236 | | { |
| | 0 | 237 | | if (IsEnabled()) |
| | | 238 | | { |
| | 0 | 239 | | WriteEvent(CreateMessageBatchExceptionEvent, identifier, exception); |
| | | 240 | | } |
| | 0 | 241 | | } |
| | | 242 | | #endregion |
| | | 243 | | |
| | | 244 | | #region Receiving |
| | | 245 | | |
| | | 246 | | [Event(ReceiveMessageStartEvent, Level = EventLevel.Informational, Message = "{0}: ReceiveBatchAsync start. Mess |
| | | 247 | | public virtual void ReceiveMessageStart(string identifier, int messageCount) |
| | | 248 | | { |
| | 4 | 249 | | if (IsEnabled()) |
| | | 250 | | { |
| | 0 | 251 | | WriteEvent(ReceiveMessageStartEvent, identifier, messageCount); |
| | | 252 | | } |
| | 4 | 253 | | } |
| | | 254 | | |
| | | 255 | | [Event(ReceiveMessageCompleteEvent, Level = EventLevel.Informational, Message = "{0}: ReceiveBatchAsync done. Re |
| | | 256 | | public virtual void ReceiveMessageComplete( |
| | | 257 | | string identifier, |
| | | 258 | | int messageCount) |
| | | 259 | | { |
| | 4 | 260 | | if (IsEnabled()) |
| | | 261 | | { |
| | 0 | 262 | | WriteEvent(ReceiveMessageCompleteEvent, identifier, messageCount); |
| | | 263 | | } |
| | 4 | 264 | | } |
| | | 265 | | |
| | | 266 | | [Event(ReceiveMessageExceptionEvent, Level = EventLevel.Error, Message = "{0}: ReceiveBatchAsync Exception: {1}. |
| | | 267 | | public virtual void ReceiveMessageException( |
| | | 268 | | string clientId, |
| | | 269 | | string exception) |
| | | 270 | | { |
| | 0 | 271 | | if (IsEnabled()) |
| | | 272 | | { |
| | 0 | 273 | | WriteEvent(ReceiveMessageExceptionEvent, clientId, exception); |
| | | 274 | | } |
| | 0 | 275 | | } |
| | | 276 | | |
| | | 277 | | [Event(ReceiveDeferredMessageStartEvent, Level = EventLevel.Informational, Message = "{0}: ReceiveDeferredMessag |
| | | 278 | | public void ReceiveDeferredMessageStartCore(string identifier, int messageCount, string sequenceNumbers) |
| | | 279 | | { |
| | 0 | 280 | | WriteEvent(ReceiveDeferredMessageStartEvent, identifier, messageCount, sequenceNumbers); |
| | 0 | 281 | | } |
| | | 282 | | |
| | | 283 | | [NonEvent] |
| | | 284 | | public virtual void ReceiveDeferredMessageStart(string identifier, IList<long> sequenceNumbers) |
| | | 285 | | { |
| | 0 | 286 | | if (IsEnabled()) |
| | | 287 | | { |
| | 0 | 288 | | var formattedSequenceNumbers = StringUtility.GetFormattedSequenceNumbers(sequenceNumbers); |
| | 0 | 289 | | ReceiveDeferredMessageStartCore(identifier, sequenceNumbers.Count, formattedSequenceNumbers); |
| | | 290 | | } |
| | 0 | 291 | | } |
| | | 292 | | |
| | | 293 | | [Event(ReceiveDeferredMessageCompleteEvent, Level = EventLevel.Informational, Message = "{0}: ReceiveDeferredMes |
| | | 294 | | public virtual void ReceiveDeferredMessageComplete(string identifier, int messageCount) |
| | | 295 | | { |
| | 0 | 296 | | if (IsEnabled()) |
| | | 297 | | { |
| | 0 | 298 | | WriteEvent(ReceiveDeferredMessageCompleteEvent, identifier, messageCount); |
| | | 299 | | } |
| | 0 | 300 | | } |
| | | 301 | | |
| | | 302 | | [Event(ReceiveDeferredMessageExceptionEvent, Level = EventLevel.Error, Message = "{0}: ReceiveDeferredMessageAsy |
| | | 303 | | public virtual void ReceiveDeferredMessageException(string identifier, string exception) |
| | | 304 | | { |
| | 0 | 305 | | if (IsEnabled()) |
| | | 306 | | { |
| | 0 | 307 | | WriteEvent(ReceiveDeferredMessageExceptionEvent, identifier, exception); |
| | | 308 | | } |
| | 0 | 309 | | } |
| | | 310 | | #endregion |
| | | 311 | | |
| | | 312 | | #region Peeking |
| | | 313 | | [Event(PeekMessageStartEvent, Level = EventLevel.Informational, Message = "{0}: MessagePeekAsync start. Sequence |
| | | 314 | | public virtual void PeekMessageStart(string identifier, long? sequenceNumber, int messageCount) |
| | | 315 | | { |
| | 0 | 316 | | if (IsEnabled()) |
| | | 317 | | { |
| | 0 | 318 | | WriteEvent(PeekMessageStartEvent, identifier, sequenceNumber, messageCount); |
| | | 319 | | } |
| | 0 | 320 | | } |
| | | 321 | | |
| | | 322 | | [Event(PeekMessageCompleteEvent, Level = EventLevel.Informational, Message = "{0}: MessagePeekAsync done. Peeked |
| | | 323 | | public virtual void PeekMessageComplete(string identifier, int messageCount) |
| | | 324 | | { |
| | 0 | 325 | | if (IsEnabled()) |
| | | 326 | | { |
| | 0 | 327 | | WriteEvent(PeekMessageCompleteEvent, identifier, messageCount); |
| | | 328 | | } |
| | 0 | 329 | | } |
| | | 330 | | |
| | | 331 | | [Event(PeekMessageExceptionEvent, Level = EventLevel.Error, Message = "{0}: MessagePeekAsync Exception: {1}.")] |
| | | 332 | | public virtual void PeekMessageException(string identifier, string exception) |
| | | 333 | | { |
| | 0 | 334 | | if (IsEnabled()) |
| | | 335 | | { |
| | 0 | 336 | | WriteEvent(PeekMessageExceptionEvent, identifier, exception); |
| | | 337 | | } |
| | 0 | 338 | | } |
| | | 339 | | #endregion |
| | | 340 | | |
| | | 341 | | #region Scheduling |
| | | 342 | | [Event(ScheduleMessageStartEvent, Level = EventLevel.Informational, Message = "{0}: ScheduleMessageAsync start. |
| | | 343 | | public virtual void ScheduleMessagesStart(string identifier, int messageCount, string scheduledEnqueueTime) |
| | | 344 | | { |
| | 0 | 345 | | if (IsEnabled()) |
| | | 346 | | { |
| | 0 | 347 | | WriteEvent(ScheduleMessageStartEvent, identifier, messageCount, scheduledEnqueueTime); |
| | | 348 | | } |
| | 0 | 349 | | } |
| | | 350 | | |
| | | 351 | | [Event(ScheduleMessageCompleteEvent, Level = EventLevel.Informational, Message = "{0}: ScheduleMessageAsync done |
| | | 352 | | public virtual void ScheduleMessagesComplete(string identifier) |
| | | 353 | | { |
| | 0 | 354 | | if (IsEnabled()) |
| | | 355 | | { |
| | 0 | 356 | | WriteEvent(ScheduleMessageCompleteEvent, identifier); |
| | | 357 | | } |
| | 0 | 358 | | } |
| | | 359 | | |
| | | 360 | | [Event(ScheduleMessageExceptionEvent, Level = EventLevel.Error, Message = "{0}: ScheduleMessageAsync Exception: |
| | | 361 | | public virtual void ScheduleMessagesException(string identifier, string exception) |
| | | 362 | | { |
| | 0 | 363 | | if (IsEnabled()) |
| | | 364 | | { |
| | 0 | 365 | | WriteEvent(ScheduleMessageExceptionEvent, identifier, exception); |
| | | 366 | | } |
| | 0 | 367 | | } |
| | | 368 | | |
| | | 369 | | [NonEvent] |
| | | 370 | | public virtual void CancelScheduledMessagesStart(string identifier, long[] sequenceNumbers) |
| | | 371 | | { |
| | 0 | 372 | | if (IsEnabled()) |
| | | 373 | | { |
| | 0 | 374 | | var formattedSequenceNumbers = StringUtility.GetFormattedSequenceNumbers(sequenceNumbers); |
| | 0 | 375 | | CancelScheduledMessagesStartCore(identifier, sequenceNumbers.Length, formattedSequenceNumbers); |
| | | 376 | | } |
| | 0 | 377 | | } |
| | | 378 | | |
| | | 379 | | [Event(CancelScheduledMessageStartEvent, Level = EventLevel.Informational, Message = "{0}: CancelScheduledMessag |
| | | 380 | | public virtual void CancelScheduledMessagesStartCore(string identifier, int messageCount, string sequenceNumbers |
| | | 381 | | { |
| | 0 | 382 | | if (IsEnabled()) |
| | | 383 | | { |
| | 0 | 384 | | WriteEvent(CancelScheduledMessageStartEvent, identifier, messageCount, sequenceNumbers); |
| | | 385 | | } |
| | 0 | 386 | | } |
| | | 387 | | |
| | | 388 | | [Event(CancelScheduledMessageCompleteEvent, Level = EventLevel.Informational, Message = "{0}: CancelScheduledMes |
| | | 389 | | public virtual void CancelScheduledMessagesComplete(string identifier) |
| | | 390 | | { |
| | 0 | 391 | | if (IsEnabled()) |
| | | 392 | | { |
| | 0 | 393 | | WriteEvent(CancelScheduledMessageCompleteEvent, identifier); |
| | | 394 | | } |
| | 0 | 395 | | } |
| | | 396 | | |
| | | 397 | | [Event(CancelScheduledMessageExceptionEvent, Level = EventLevel.Error, Message = "{0}: CancelScheduledMessageAsy |
| | | 398 | | public virtual void CancelScheduledMessagesException(string identifier, string exception) |
| | | 399 | | { |
| | 0 | 400 | | if (IsEnabled()) |
| | | 401 | | { |
| | 0 | 402 | | WriteEvent(CancelScheduledMessageExceptionEvent, identifier, exception); |
| | | 403 | | } |
| | 0 | 404 | | } |
| | | 405 | | #endregion |
| | | 406 | | |
| | | 407 | | #region Settlement |
| | | 408 | | [Event(CompleteMessageStartEvent, Level = EventLevel.Informational, Message = "{0}: CompleteAsync start. Message |
| | | 409 | | public virtual void CompleteMessageStart(string identifier, int messageCount, string lockTokens) |
| | | 410 | | { |
| | 0 | 411 | | if (IsEnabled()) |
| | | 412 | | { |
| | 0 | 413 | | WriteEvent(CompleteMessageStartEvent, identifier, messageCount, lockTokens); |
| | | 414 | | } |
| | 0 | 415 | | } |
| | | 416 | | |
| | | 417 | | [Event(CompleteMessageCompleteEvent, Level = EventLevel.Informational, Message = "{0}: CompleteAsync done.")] |
| | | 418 | | public virtual void CompleteMessageComplete(string identifier) |
| | | 419 | | { |
| | 0 | 420 | | if (IsEnabled()) |
| | | 421 | | { |
| | 0 | 422 | | WriteEvent(CompleteMessageCompleteEvent, identifier); |
| | | 423 | | } |
| | 0 | 424 | | } |
| | | 425 | | |
| | | 426 | | [Event(CompleteMessageExceptionEvent, Level = EventLevel.Error, Message = "{0}: CompleteAsync Exception: {1}.")] |
| | | 427 | | public virtual void CompleteMessageException(string identifier, string exception) |
| | | 428 | | { |
| | 0 | 429 | | if (IsEnabled()) |
| | | 430 | | { |
| | 0 | 431 | | WriteEvent(CompleteMessageExceptionEvent, identifier, exception); |
| | | 432 | | } |
| | 0 | 433 | | } |
| | | 434 | | |
| | | 435 | | [Event(DeferMessageStartEvent, Level = EventLevel.Informational, Message = "{0}: DeferAsync start. MessageCount |
| | | 436 | | public virtual void DeferMessageStart(string identifier, int messageCount, string lockToken) |
| | | 437 | | { |
| | 0 | 438 | | if (IsEnabled()) |
| | | 439 | | { |
| | 0 | 440 | | WriteEvent(DeferMessageStartEvent, identifier, messageCount, lockToken); |
| | | 441 | | } |
| | 0 | 442 | | } |
| | | 443 | | |
| | | 444 | | [Event(DeferMessageCompleteEvent, Level = EventLevel.Informational, Message = "{0}: DeferAsync done.")] |
| | | 445 | | public virtual void DeferMessageComplete(string identifier) |
| | | 446 | | { |
| | 0 | 447 | | if (IsEnabled()) |
| | | 448 | | { |
| | 0 | 449 | | WriteEvent(DeferMessageCompleteEvent, identifier); |
| | | 450 | | } |
| | 0 | 451 | | } |
| | | 452 | | |
| | | 453 | | [Event(DeferMessageExceptionEvent, Level = EventLevel.Error, Message = "{0}: DeferAsync Exception: {1}.")] |
| | | 454 | | public virtual void DeferMessageException(string identifier, string exception) |
| | | 455 | | { |
| | 0 | 456 | | WriteEvent(DeferMessageExceptionEvent, identifier, exception); |
| | 0 | 457 | | } |
| | | 458 | | |
| | | 459 | | [Event(AbandonMessageStartEvent, Level = EventLevel.Informational, Message = "{0}: AbandonAsync start. MessageCo |
| | | 460 | | public virtual void AbandonMessageStart(string identifier, int messageCount, string lockToken) |
| | | 461 | | { |
| | 0 | 462 | | if (IsEnabled()) |
| | | 463 | | { |
| | 0 | 464 | | WriteEvent(AbandonMessageStartEvent, identifier, messageCount, lockToken); |
| | | 465 | | } |
| | 0 | 466 | | } |
| | | 467 | | |
| | | 468 | | [Event(AbandonMessageCompleteEvent, Level = EventLevel.Informational, Message = "{0}: AbandonAsync done.")] |
| | | 469 | | public virtual void AbandonMessageComplete(string identifier) |
| | | 470 | | { |
| | 0 | 471 | | if (IsEnabled()) |
| | | 472 | | { |
| | 0 | 473 | | WriteEvent(AbandonMessageCompleteEvent, identifier); |
| | | 474 | | } |
| | 0 | 475 | | } |
| | | 476 | | |
| | | 477 | | [Event(AbandonMessageExceptionEvent, Level = EventLevel.Error, Message = "{0}: AbandonAsync Exception: {1}.")] |
| | | 478 | | public virtual void AbandonMessageException(string identifier, string exception) |
| | | 479 | | { |
| | 0 | 480 | | if (IsEnabled()) |
| | | 481 | | { |
| | 0 | 482 | | WriteEvent(AbandonMessageExceptionEvent, identifier, exception); |
| | | 483 | | } |
| | 0 | 484 | | } |
| | | 485 | | |
| | | 486 | | [Event(DeadLetterMessageStartEvent, Level = EventLevel.Informational, Message = "{0}: DeadLetterAsync start. Mes |
| | | 487 | | public virtual void DeadLetterMessageStart(string identifier, int messageCount, string lockToken) |
| | | 488 | | { |
| | 0 | 489 | | if (IsEnabled()) |
| | | 490 | | { |
| | 0 | 491 | | WriteEvent(DeadLetterMessageStartEvent, identifier, messageCount, lockToken); |
| | | 492 | | } |
| | 0 | 493 | | } |
| | | 494 | | |
| | | 495 | | [Event(DeadLetterMessageCompleteEvent, Level = EventLevel.Informational, Message = "{0}: DeadLetterAsync done.") |
| | | 496 | | public virtual void DeadLetterMessageComplete(string identifier) |
| | | 497 | | { |
| | 0 | 498 | | if (IsEnabled()) |
| | | 499 | | { |
| | 0 | 500 | | WriteEvent(DeadLetterMessageCompleteEvent, identifier); |
| | | 501 | | } |
| | 0 | 502 | | } |
| | | 503 | | |
| | | 504 | | [Event(DeadLetterMessageExceptionEvent, Level = EventLevel.Error, Message = "{0}: DeadLetterAsync Exception: {1} |
| | | 505 | | public virtual void DeadLetterMessageException(string identifier, string exception) |
| | | 506 | | { |
| | 0 | 507 | | if (IsEnabled()) |
| | | 508 | | { |
| | 0 | 509 | | WriteEvent(DeadLetterMessageExceptionEvent, identifier, exception); |
| | | 510 | | } |
| | 0 | 511 | | } |
| | | 512 | | #endregion |
| | | 513 | | |
| | | 514 | | #region Lock renewal |
| | | 515 | | [Event(RenewMessageLockStartEvent, Level = EventLevel.Informational, Message = "{0}: RenewLockAsync start. Messa |
| | | 516 | | public virtual void RenewMessageLockStart(string identifier, int messageCount, string lockToken) |
| | | 517 | | { |
| | 0 | 518 | | if (IsEnabled()) |
| | | 519 | | { |
| | 0 | 520 | | WriteEvent(RenewMessageLockStartEvent, identifier, messageCount, lockToken); |
| | | 521 | | } |
| | 0 | 522 | | } |
| | | 523 | | |
| | | 524 | | [Event(RenewMessageLockCompleteEvent, Level = EventLevel.Informational, Message = "{0}: RenewLockAsync done.")] |
| | | 525 | | public virtual void RenewMessageLockComplete(string identifier) |
| | | 526 | | { |
| | 0 | 527 | | if (IsEnabled()) |
| | | 528 | | { |
| | 0 | 529 | | WriteEvent(RenewMessageLockCompleteEvent, identifier); |
| | | 530 | | } |
| | 0 | 531 | | } |
| | | 532 | | |
| | | 533 | | [Event(RenewMessageLockExceptionEvent, Level = EventLevel.Error, Message = "{0}: RenewLockAsync Exception: {1}." |
| | | 534 | | public virtual void RenewMessageLockException(string identifier, string exception) |
| | | 535 | | { |
| | 0 | 536 | | if (IsEnabled()) |
| | | 537 | | { |
| | 0 | 538 | | WriteEvent(RenewMessageLockExceptionEvent, identifier, exception); |
| | | 539 | | } |
| | 0 | 540 | | } |
| | | 541 | | |
| | | 542 | | [Event(RenewSessionLockStartEvent, Level = EventLevel.Informational, Message = "{0}: RenewSessionLockAsync start |
| | | 543 | | public virtual void RenewSessionLockStart(string identifier, string sessionId) |
| | | 544 | | { |
| | 0 | 545 | | if (IsEnabled()) |
| | | 546 | | { |
| | 0 | 547 | | WriteEvent(RenewSessionLockStartEvent, identifier, sessionId); |
| | | 548 | | } |
| | 0 | 549 | | } |
| | | 550 | | |
| | | 551 | | [Event(RenewSessionLockCompleteEvent, Level = EventLevel.Informational, Message = "{0}: RenewSessionLockAsync do |
| | | 552 | | public virtual void RenewSessionLockComplete(string identifier) |
| | | 553 | | { |
| | 0 | 554 | | if (IsEnabled()) |
| | | 555 | | { |
| | 0 | 556 | | WriteEvent(RenewSessionLockCompleteEvent, identifier); |
| | | 557 | | } |
| | 0 | 558 | | } |
| | | 559 | | |
| | | 560 | | [Event(RenewSessionLockExceptionEvent, Level = EventLevel.Error, Message = "{0}: RenewSessionLockAsync Exception |
| | | 561 | | public virtual void RenewSessionLockException(string identifier, string exception) |
| | | 562 | | { |
| | 0 | 563 | | if (IsEnabled()) |
| | | 564 | | { |
| | 0 | 565 | | WriteEvent(RenewSessionLockExceptionEvent, identifier, exception); |
| | | 566 | | } |
| | 0 | 567 | | } |
| | | 568 | | #endregion |
| | | 569 | | |
| | | 570 | | #region Get/Set session state |
| | | 571 | | |
| | | 572 | | [Event(GetSessionStateStartEvent, Level = EventLevel.Informational, Message = "{0}: Session GetStateAsync start. |
| | | 573 | | public virtual void GetSessionStateStart(string identifiers, string sessionId) |
| | | 574 | | { |
| | 0 | 575 | | if (IsEnabled()) |
| | | 576 | | { |
| | 0 | 577 | | WriteEvent(GetSessionStateStartEvent, identifiers, sessionId); |
| | | 578 | | } |
| | 0 | 579 | | } |
| | | 580 | | |
| | | 581 | | [Event(GetSessionStateCompleteEvent, Level = EventLevel.Informational, Message = "{0}: Session GetStateAsync don |
| | | 582 | | public virtual void GetSessionStateComplete(string identifier) |
| | | 583 | | { |
| | 0 | 584 | | if (IsEnabled()) |
| | | 585 | | { |
| | 0 | 586 | | WriteEvent(GetSessionStateCompleteEvent, identifier); |
| | | 587 | | } |
| | 0 | 588 | | } |
| | | 589 | | |
| | | 590 | | [Event(GetSessionStateExceptionEvent, Level = EventLevel.Error, Message = "{0}: Session GetStateAsync Exception: |
| | | 591 | | public virtual void GetSessionStateException(string identifier, string exception) |
| | | 592 | | { |
| | 0 | 593 | | if (IsEnabled()) |
| | | 594 | | { |
| | 0 | 595 | | WriteEvent(GetSessionStateExceptionEvent, identifier, exception); |
| | | 596 | | } |
| | 0 | 597 | | } |
| | | 598 | | |
| | | 599 | | [Event(SetSessionStateStartEvent, Level = EventLevel.Informational, Message = "{0}: Session SetStateAsync start. |
| | | 600 | | public virtual void SetSessionStateStart(string identifiers, string sessionId) |
| | | 601 | | { |
| | 0 | 602 | | if (IsEnabled()) |
| | | 603 | | { |
| | 0 | 604 | | WriteEvent(SetSessionStateStartEvent, identifiers, sessionId); |
| | | 605 | | } |
| | 0 | 606 | | } |
| | | 607 | | |
| | | 608 | | [Event(SetSessionStateCompleteEvent, Level = EventLevel.Informational, Message = "{0}: Session SetStateAsync don |
| | | 609 | | public virtual void SetSessionStateComplete(string identifier) |
| | | 610 | | { |
| | 0 | 611 | | if (IsEnabled()) |
| | | 612 | | { |
| | 0 | 613 | | WriteEvent(SetSessionStateCompleteEvent, identifier); |
| | | 614 | | } |
| | 0 | 615 | | } |
| | | 616 | | |
| | | 617 | | [Event(SetSessionStateExceptionEvent, Level = EventLevel.Error, Message = "{0}: Session SetStateAsync Exception: |
| | | 618 | | public virtual void SetSessionStateException(string identifier, string exception) |
| | | 619 | | { |
| | 0 | 620 | | if (IsEnabled()) |
| | | 621 | | { |
| | 0 | 622 | | WriteEvent(SetSessionStateExceptionEvent, identifier, exception); |
| | | 623 | | } |
| | 0 | 624 | | } |
| | | 625 | | #endregion |
| | | 626 | | |
| | | 627 | | #region Processor |
| | | 628 | | |
| | | 629 | | [Event(StartProcessingStartEvent, Level = EventLevel.Informational, Message = "{0}: StartProcessingAsync start." |
| | | 630 | | public virtual void StartProcessingStart(string identifier) |
| | | 631 | | { |
| | 8 | 632 | | if (IsEnabled()) |
| | | 633 | | { |
| | 0 | 634 | | WriteEvent(StartProcessingStartEvent, identifier); |
| | | 635 | | } |
| | 8 | 636 | | } |
| | | 637 | | |
| | | 638 | | [Event(StartProcessingCompleteEvent, Level = EventLevel.Informational, Message = "{0}: StartProcessingAsync done |
| | | 639 | | public virtual void StartProcessingComplete(string identifier) |
| | | 640 | | { |
| | 0 | 641 | | if (IsEnabled()) |
| | | 642 | | { |
| | 0 | 643 | | WriteEvent(StartProcessingCompleteEvent, identifier); |
| | | 644 | | } |
| | 0 | 645 | | } |
| | | 646 | | |
| | | 647 | | [Event(StartProcessingExceptionEvent, Level = EventLevel.Error, Message = "{0}: StartProcessingAsync Exception: |
| | | 648 | | public virtual void StartProcessingException(string identifier, string exception) |
| | | 649 | | { |
| | 8 | 650 | | if (IsEnabled()) |
| | | 651 | | { |
| | 0 | 652 | | WriteEvent(StartProcessingExceptionEvent, identifier, exception); |
| | | 653 | | } |
| | 8 | 654 | | } |
| | | 655 | | |
| | | 656 | | [Event(StopProcessingStartEvent, Level = EventLevel.Informational, Message = "{0}: StopProcessingAsync start.")] |
| | | 657 | | public virtual void StopProcessingStart(string identifier) |
| | | 658 | | { |
| | 0 | 659 | | if (IsEnabled()) |
| | | 660 | | { |
| | 0 | 661 | | WriteEvent(StopProcessingStartEvent, identifier); |
| | | 662 | | } |
| | 0 | 663 | | } |
| | | 664 | | |
| | | 665 | | [Event(StopProcessingCompleteEvent, Level = EventLevel.Informational, Message = "{0}: StopProcessingAsync done." |
| | | 666 | | public virtual void StopProcessingComplete(string identifier) |
| | | 667 | | { |
| | 0 | 668 | | if (IsEnabled()) |
| | | 669 | | { |
| | 0 | 670 | | WriteEvent(StopProcessingCompleteEvent, identifier); |
| | | 671 | | } |
| | 0 | 672 | | } |
| | | 673 | | |
| | | 674 | | [Event(StopProcessingExceptionEvent, Level = EventLevel.Error, Message = "{0}: StopProcessingAsync Exception: {1 |
| | | 675 | | public virtual void StopProcessingException(string identifier, string exception) |
| | | 676 | | { |
| | 0 | 677 | | if (IsEnabled()) |
| | | 678 | | { |
| | 0 | 679 | | WriteEvent(StopProcessingExceptionEvent, identifier, exception); |
| | | 680 | | } |
| | 0 | 681 | | } |
| | | 682 | | |
| | | 683 | | [Event(ProcessorRenewMessageLockStartEvent, Level = EventLevel.Informational, Message = "{0}: Processor RenewMes |
| | | 684 | | public virtual void ProcessorRenewMessageLockStart(string identifier, int messageCount, string lockToken) |
| | | 685 | | { |
| | 0 | 686 | | if (IsEnabled()) |
| | | 687 | | { |
| | 0 | 688 | | WriteEvent(ProcessorRenewMessageLockStartEvent, identifier, messageCount, lockToken); |
| | | 689 | | } |
| | 0 | 690 | | } |
| | | 691 | | |
| | | 692 | | [Event(ProcessorRenewMessageLockCompleteEvent, Level = EventLevel.Informational, Message = "{0}: Processor Renew |
| | | 693 | | public virtual void ProcessorRenewMessageLockComplete(string identifier) |
| | | 694 | | { |
| | 0 | 695 | | if (IsEnabled()) |
| | | 696 | | { |
| | 0 | 697 | | WriteEvent(ProcessorRenewMessageLockCompleteEvent, identifier); |
| | | 698 | | } |
| | 0 | 699 | | } |
| | | 700 | | |
| | | 701 | | [Event(ProcessorRenewMessageLockExceptionEvent, Level = EventLevel.Error, Message = "{0}: Processor RenewMessage |
| | | 702 | | public virtual void ProcessorRenewMessageLockException(string identifier, string exception) |
| | | 703 | | { |
| | 0 | 704 | | if (IsEnabled()) |
| | | 705 | | { |
| | 0 | 706 | | WriteEvent(ProcessorRenewMessageLockExceptionEvent, identifier, exception); |
| | | 707 | | } |
| | 0 | 708 | | } |
| | | 709 | | |
| | | 710 | | [Event(ProcessorRenewSessionLockStartEvent, Level = EventLevel.Informational, Message = "{0}: Processor RenewSes |
| | | 711 | | public virtual void ProcessorRenewSessionLockStart(string identifier, string sessionId) |
| | | 712 | | { |
| | 0 | 713 | | if (IsEnabled()) |
| | | 714 | | { |
| | 0 | 715 | | WriteEvent(ProcessorRenewSessionLockStartEvent, identifier, sessionId); |
| | | 716 | | } |
| | 0 | 717 | | } |
| | | 718 | | |
| | | 719 | | [Event(ProcessorRenewSessionLockCompleteEvent, Level = EventLevel.Informational, Message = "{0}: Processor Renew |
| | | 720 | | public virtual void ProcessorRenewSessionLockComplete(string identifier) |
| | | 721 | | { |
| | 0 | 722 | | if (IsEnabled()) |
| | | 723 | | { |
| | 0 | 724 | | WriteEvent(ProcessorRenewSessionLockCompleteEvent, identifier); |
| | | 725 | | } |
| | 0 | 726 | | } |
| | | 727 | | |
| | | 728 | | [Event(ProcessorRenewSessionLockExceptionEvent, Level = EventLevel.Error, Message = "{0}: Processor RenewSession |
| | | 729 | | public virtual void ProcessorRenewSessionLockException(string identifier, string exception) |
| | | 730 | | { |
| | 0 | 731 | | if (IsEnabled()) |
| | | 732 | | { |
| | 0 | 733 | | WriteEvent(ProcessorRenewSessionLockExceptionEvent, identifier, exception); |
| | | 734 | | } |
| | 0 | 735 | | } |
| | | 736 | | |
| | | 737 | | [Event(ProcessorErrorHandlerThrewExceptionEvent, Level = EventLevel.Error, Message = "ExceptionReceivedHandler t |
| | | 738 | | public void ProcessorErrorHandlerThrewException(string exception) |
| | | 739 | | { |
| | 0 | 740 | | if (IsEnabled()) |
| | | 741 | | { |
| | 0 | 742 | | WriteEvent(ProcessorErrorHandlerThrewExceptionEvent, exception); |
| | | 743 | | } |
| | 0 | 744 | | } |
| | | 745 | | |
| | | 746 | | #endregion region |
| | | 747 | | |
| | | 748 | | #region Rule management |
| | | 749 | | [Event(AddRuleStartEvent, Level = EventLevel.Informational, Message = "{0}: Add rule start. RuleName = {1}")] |
| | | 750 | | public virtual void AddRuleStart(string identifiers, string ruleName) |
| | | 751 | | { |
| | 0 | 752 | | if (IsEnabled()) |
| | | 753 | | { |
| | 0 | 754 | | WriteEvent(AddRuleStartEvent, identifiers, ruleName); |
| | | 755 | | } |
| | 0 | 756 | | } |
| | | 757 | | |
| | | 758 | | [Event(AddRuleCompleteEvent, Level = EventLevel.Informational, Message = "{0}: Add rule done.")] |
| | | 759 | | public virtual void AddRuleComplete(string identifier) |
| | | 760 | | { |
| | 0 | 761 | | if (IsEnabled()) |
| | | 762 | | { |
| | 0 | 763 | | WriteEvent(AddRuleCompleteEvent, identifier); |
| | | 764 | | } |
| | 0 | 765 | | } |
| | | 766 | | |
| | | 767 | | [Event(AddRuleExceptionEvent, Level = EventLevel.Error, Message = "{0}: Add rule Exception: {1}.")] |
| | | 768 | | public virtual void AddRuleException(string identifier, string exception) |
| | | 769 | | { |
| | 0 | 770 | | if (IsEnabled()) |
| | | 771 | | { |
| | 0 | 772 | | WriteEvent(AddRuleExceptionEvent, identifier, exception); |
| | | 773 | | } |
| | 0 | 774 | | } |
| | | 775 | | |
| | | 776 | | [Event(RemoveRuleStartEvent, Level = EventLevel.Informational, Message = "{0}: Remove rule start. RuleName = {1} |
| | | 777 | | public virtual void RemoveRuleStart(string identifiers, string ruleName) |
| | | 778 | | { |
| | 0 | 779 | | if (IsEnabled()) |
| | | 780 | | { |
| | 0 | 781 | | WriteEvent(RemoveRuleStartEvent, identifiers, ruleName); |
| | | 782 | | } |
| | 0 | 783 | | } |
| | | 784 | | |
| | | 785 | | [Event(RemoveRuleCompleteEvent, Level = EventLevel.Informational, Message = "{0}: Remove rule done.")] |
| | | 786 | | public virtual void RemoveRuleComplete(string identifier) |
| | | 787 | | { |
| | 0 | 788 | | if (IsEnabled()) |
| | | 789 | | { |
| | 0 | 790 | | WriteEvent(RemoveRuleCompleteEvent, identifier); |
| | | 791 | | } |
| | 0 | 792 | | } |
| | | 793 | | |
| | | 794 | | [Event(RemoveRuleExceptionEvent, Level = EventLevel.Error, Message = "{0}: Remove rule Exception: {1}.")] |
| | | 795 | | public virtual void RemoveRuleException(string identifier, string exception) |
| | | 796 | | { |
| | 0 | 797 | | if (IsEnabled()) |
| | | 798 | | { |
| | 0 | 799 | | WriteEvent(RemoveRuleExceptionEvent, identifier, exception); |
| | | 800 | | } |
| | 0 | 801 | | } |
| | | 802 | | |
| | | 803 | | [Event(GetRuleStartEvent, Level = EventLevel.Informational, Message = "{0}: Get rule start.")] |
| | | 804 | | public virtual void GetRuleStart(string identifiers) |
| | | 805 | | { |
| | 0 | 806 | | if (IsEnabled()) |
| | | 807 | | { |
| | 0 | 808 | | WriteEvent(GetRuleStartEvent, identifiers); |
| | | 809 | | } |
| | 0 | 810 | | } |
| | | 811 | | |
| | | 812 | | [Event(GetRuleCompleteEvent, Level = EventLevel.Informational, Message = "{0}: Get rule done.")] |
| | | 813 | | public virtual void GetRuleComplete(string identifier) |
| | | 814 | | { |
| | 0 | 815 | | if (IsEnabled()) |
| | | 816 | | { |
| | 0 | 817 | | WriteEvent(GetRuleCompleteEvent, identifier); |
| | | 818 | | } |
| | 0 | 819 | | } |
| | | 820 | | |
| | | 821 | | [Event(GetRuleExceptionEvent, Level = EventLevel.Error, Message = "{0}: Get rule Exception: {1}.")] |
| | | 822 | | public virtual void GetRuleException(string identifier, string exception) |
| | | 823 | | { |
| | 0 | 824 | | if (IsEnabled()) |
| | | 825 | | { |
| | 0 | 826 | | WriteEvent(GetRuleExceptionEvent, identifier, exception); |
| | | 827 | | } |
| | 0 | 828 | | } |
| | | 829 | | #endregion |
| | | 830 | | |
| | | 831 | | #region Link lifecycle |
| | | 832 | | [Event(LinkStateLostEvent, Level = EventLevel.Error, Message = "Link state lost. Throwing LockLostException for |
| | | 833 | | public virtual void LinkStateLost(string identifier, string receiveLinkName, string receiveLinkState, bool isSes |
| | | 834 | | { |
| | 0 | 835 | | if (IsEnabled()) |
| | | 836 | | { |
| | 0 | 837 | | WriteEvent(LinkStateLostEvent, identifier, receiveLinkName, receiveLinkState, isSessionReceiver, excepti |
| | | 838 | | } |
| | 0 | 839 | | } |
| | | 840 | | |
| | | 841 | | [NonEvent] |
| | | 842 | | public virtual void ReceiveLinkClosed( |
| | | 843 | | string identifier, |
| | | 844 | | string sessionId, |
| | | 845 | | object receiver) |
| | | 846 | | { |
| | 0 | 847 | | if (IsEnabled()) |
| | | 848 | | { |
| | 0 | 849 | | var link = (ReceivingAmqpLink)receiver; |
| | 0 | 850 | | if (link != null) |
| | | 851 | | { |
| | 0 | 852 | | Exception exception = link.GetInnerException(); |
| | 0 | 853 | | ReceiveLinkClosedCore( |
| | 0 | 854 | | identifier, |
| | 0 | 855 | | sessionId, |
| | 0 | 856 | | exception?.ToString()); |
| | | 857 | | } |
| | | 858 | | } |
| | 0 | 859 | | } |
| | | 860 | | |
| | | 861 | | [Event(ReceiveLinkClosedEvent, Level = EventLevel.Informational, Message = "Receive Link Closed. Identifier: {0} |
| | | 862 | | public virtual void ReceiveLinkClosedCore(string identifier, string sessionId, string linkException) |
| | | 863 | | { |
| | 0 | 864 | | if (IsEnabled()) |
| | | 865 | | { |
| | 0 | 866 | | WriteEvent(ReceiveLinkClosedEvent, identifier, sessionId, linkException); |
| | | 867 | | } |
| | 0 | 868 | | } |
| | | 869 | | |
| | | 870 | | /// <summary> |
| | | 871 | | /// Indicates that refreshing authorization for an AMQP link has started. |
| | | 872 | | /// </summary> |
| | | 873 | | /// |
| | | 874 | | /// <param name="identifier">The name of the Entity that the link is associated with.</param> |
| | | 875 | | /// <param name="endpoint">The service endpoint that the link is bound to for communication.</param> |
| | | 876 | | /// |
| | | 877 | | [Event(AmqpLinkRefreshStartEvent, Level = EventLevel.Informational, Message = "Beginning refresh of AMQP link au |
| | | 878 | | public virtual void AmqpLinkAuthorizationRefreshStart( |
| | | 879 | | string identifier, |
| | | 880 | | string endpoint) |
| | | 881 | | { |
| | 0 | 882 | | if (IsEnabled()) |
| | | 883 | | { |
| | 0 | 884 | | WriteEvent(AmqpLinkRefreshStartEvent, identifier ?? string.Empty, endpoint ?? string.Empty); |
| | | 885 | | } |
| | 0 | 886 | | } |
| | | 887 | | |
| | | 888 | | /// <summary> |
| | | 889 | | /// Indicates that refreshing authorization for an AMQP link has completed. |
| | | 890 | | /// </summary> |
| | | 891 | | /// |
| | | 892 | | /// <param name="identifier">The name of the Entity that the link is associated with.</param> |
| | | 893 | | /// <param name="endpoint">The service endpoint that the link is bound to for communication.</param> |
| | | 894 | | /// |
| | | 895 | | [Event(AmqpLinkRefreshCompleteEvent, Level = EventLevel.Informational, Message = "Completed refresh of AMQP link |
| | | 896 | | public virtual void AmqpLinkAuthorizationRefreshComplete( |
| | | 897 | | string identifier, |
| | | 898 | | string endpoint) |
| | | 899 | | { |
| | 0 | 900 | | if (IsEnabled()) |
| | | 901 | | { |
| | 0 | 902 | | WriteEvent(AmqpLinkRefreshCompleteEvent, identifier ?? string.Empty, endpoint ?? string.Empty); |
| | | 903 | | } |
| | 0 | 904 | | } |
| | | 905 | | |
| | | 906 | | /// <summary> |
| | | 907 | | /// Indicates that an exception was encountered while refreshing authorization for an AMQP link has started. |
| | | 908 | | /// </summary> |
| | | 909 | | /// |
| | | 910 | | /// <param name="identifier">The name of the Entity that the link is associated with.</param> |
| | | 911 | | /// <param name="endpoint">The service endpoint that the link is bound to for communication.</param> |
| | | 912 | | /// <param name="errorMessage">The message for the exception that occurred.</param> |
| | | 913 | | /// |
| | | 914 | | [Event(AmqpLinkRefreshExceptionEvent, Level = EventLevel.Error, Message = "An exception occurred while refreshin |
| | | 915 | | public virtual void AmqpLinkAuthorizationRefreshError( |
| | | 916 | | string identifier, |
| | | 917 | | string endpoint, |
| | | 918 | | string errorMessage) |
| | | 919 | | { |
| | 0 | 920 | | if (IsEnabled()) |
| | | 921 | | { |
| | 0 | 922 | | WriteEvent(AmqpLinkRefreshExceptionEvent, identifier ?? string.Empty, endpoint ?? string.Empty, errorMes |
| | | 923 | | } |
| | 0 | 924 | | } |
| | | 925 | | |
| | | 926 | | [Event(CreateSendLinkStartEvent, Level = EventLevel.Informational, Message = "Creating send link for Identifier: |
| | | 927 | | public virtual void CreateSendLinkStart( |
| | | 928 | | string identifier) |
| | | 929 | | { |
| | 0 | 930 | | if (IsEnabled()) |
| | | 931 | | { |
| | 0 | 932 | | WriteEvent(CreateSendLinkStartEvent, identifier); |
| | | 933 | | } |
| | 0 | 934 | | } |
| | | 935 | | |
| | | 936 | | [Event(CreateSendLinkCompleteEvent, Level = EventLevel.Informational, Message = "Send link created for Identifie |
| | | 937 | | public virtual void CreateSendLinkComplete( |
| | | 938 | | string identifier) |
| | | 939 | | { |
| | 0 | 940 | | if (IsEnabled()) |
| | | 941 | | { |
| | 0 | 942 | | WriteEvent(CreateSendLinkCompleteEvent, identifier); |
| | | 943 | | } |
| | 0 | 944 | | } |
| | | 945 | | |
| | | 946 | | [Event(CreateSendLinkExceptionEvent, Level = EventLevel.Error, Message = "An exception occurred while creating s |
| | | 947 | | public virtual void CreateSendLinkException( |
| | | 948 | | string identifier, |
| | | 949 | | string exception) |
| | | 950 | | { |
| | 0 | 951 | | if (IsEnabled()) |
| | | 952 | | { |
| | 0 | 953 | | WriteEvent(CreateSendLinkExceptionEvent, identifier, exception); |
| | | 954 | | } |
| | 0 | 955 | | } |
| | | 956 | | |
| | | 957 | | [NonEvent] |
| | | 958 | | public virtual void SendLinkClosed( |
| | | 959 | | string identifier, |
| | | 960 | | object sender) |
| | | 961 | | { |
| | 0 | 962 | | if (IsEnabled()) |
| | | 963 | | { |
| | 0 | 964 | | var link = (SendingAmqpLink)sender; |
| | 0 | 965 | | if (link != null) |
| | | 966 | | { |
| | 0 | 967 | | Exception exception = link.GetInnerException(); |
| | 0 | 968 | | SendLinkClosedCore( |
| | 0 | 969 | | identifier, |
| | 0 | 970 | | exception?.ToString()); |
| | | 971 | | } |
| | | 972 | | } |
| | 0 | 973 | | } |
| | | 974 | | |
| | | 975 | | [Event(SendLinkClosedEvent, Level = EventLevel.Informational, Message = "Send Link Closed. Identifier: {0}, link |
| | | 976 | | public virtual void SendLinkClosedCore( |
| | | 977 | | string identifier, |
| | | 978 | | string linkException) |
| | | 979 | | { |
| | 0 | 980 | | if (IsEnabled()) |
| | | 981 | | { |
| | 0 | 982 | | WriteEvent(SendLinkClosedEvent, identifier, linkException); |
| | | 983 | | } |
| | 0 | 984 | | } |
| | | 985 | | |
| | | 986 | | [Event(CreateReceiveLinkStartEvent, Level = EventLevel.Informational, Message = "Creating receive link for Ident |
| | | 987 | | public virtual void CreateReceiveLinkStart(string identifier) |
| | | 988 | | { |
| | 36 | 989 | | if (IsEnabled()) |
| | | 990 | | { |
| | 0 | 991 | | WriteEvent(CreateReceiveLinkStartEvent, identifier); |
| | | 992 | | } |
| | 36 | 993 | | } |
| | | 994 | | |
| | | 995 | | [Event(CreateReceiveLinkCompleteEvent, Level = EventLevel.Informational, Message = "Receive link created for Ide |
| | | 996 | | public virtual void CreateReceiveLinkComplete(string identifier) |
| | | 997 | | { |
| | 0 | 998 | | if (IsEnabled()) |
| | | 999 | | { |
| | 0 | 1000 | | WriteEvent(CreateReceiveLinkCompleteEvent, identifier); |
| | | 1001 | | } |
| | 0 | 1002 | | } |
| | | 1003 | | |
| | | 1004 | | [Event(CreateReceiveLinkExceptionEvent, Level = EventLevel.Error, Message = "An exception occurred while creatin |
| | | 1005 | | public virtual void CreateReceiveLinkException(string identifier, string exception) |
| | | 1006 | | { |
| | 36 | 1007 | | if (IsEnabled()) |
| | | 1008 | | { |
| | 0 | 1009 | | WriteEvent(CreateReceiveLinkExceptionEvent, identifier, exception); |
| | | 1010 | | } |
| | 36 | 1011 | | } |
| | | 1012 | | |
| | | 1013 | | [Event(CreateManagementLinkStartEvent, Level = EventLevel.Informational, Message = "Creating management link for |
| | | 1014 | | public virtual void CreateManagementLinkStart(string identifier) |
| | | 1015 | | { |
| | 0 | 1016 | | if (IsEnabled()) |
| | | 1017 | | { |
| | 0 | 1018 | | WriteEvent(CreateManagementLinkStartEvent, identifier); |
| | | 1019 | | } |
| | 0 | 1020 | | } |
| | | 1021 | | |
| | | 1022 | | [Event(CreateManagementLinkCompleteEvent, Level = EventLevel.Informational, Message = "Management link created f |
| | | 1023 | | public virtual void CreateManagementLinkComplete(string identifier) |
| | | 1024 | | { |
| | 0 | 1025 | | if (IsEnabled()) |
| | | 1026 | | { |
| | 0 | 1027 | | WriteEvent(CreateManagementLinkCompleteEvent, identifier); |
| | | 1028 | | } |
| | 0 | 1029 | | } |
| | | 1030 | | |
| | | 1031 | | [Event(CreateManagementLinkExceptionEvent, Level = EventLevel.Error, Message = "An exception occurred while crea |
| | | 1032 | | public virtual void CreateManagementLinkException(string identifier, string exception) |
| | | 1033 | | { |
| | 0 | 1034 | | if (IsEnabled()) |
| | | 1035 | | { |
| | 0 | 1036 | | WriteEvent(CreateManagementLinkExceptionEvent, identifier, exception); |
| | | 1037 | | } |
| | 0 | 1038 | | } |
| | | 1039 | | |
| | | 1040 | | [NonEvent] |
| | | 1041 | | public virtual void ManagementLinkClosed( |
| | | 1042 | | string identifier, |
| | | 1043 | | object managementLink) |
| | | 1044 | | { |
| | 0 | 1045 | | if (IsEnabled()) |
| | | 1046 | | { |
| | 0 | 1047 | | var link = (RequestResponseAmqpLink)managementLink; |
| | 0 | 1048 | | if (link != null) |
| | | 1049 | | { |
| | 0 | 1050 | | Exception exception = link.GetInnerException(); |
| | 0 | 1051 | | ManagementLinkClosedCore( |
| | 0 | 1052 | | identifier, |
| | 0 | 1053 | | exception?.ToString()); |
| | | 1054 | | } |
| | | 1055 | | } |
| | 0 | 1056 | | } |
| | | 1057 | | |
| | | 1058 | | [Event(ManagementLinkClosedEvent, Level = EventLevel.Informational, Message = "Management Link Closed. Identifie |
| | | 1059 | | public virtual void ManagementLinkClosedCore( |
| | | 1060 | | string identifier, |
| | | 1061 | | string linkException) |
| | | 1062 | | { |
| | 0 | 1063 | | if (IsEnabled()) |
| | | 1064 | | { |
| | 0 | 1065 | | WriteEvent(ManagementLinkClosedEvent, identifier, linkException); |
| | | 1066 | | } |
| | 0 | 1067 | | } |
| | | 1068 | | #endregion |
| | | 1069 | | |
| | | 1070 | | #region Retries |
| | | 1071 | | |
| | | 1072 | | [Event(RunOperationExceptionEvent, Level = EventLevel.Warning, Message = "RunOperation encountered an exception |
| | | 1073 | | public virtual void RunOperationExceptionEncountered(string exception) |
| | | 1074 | | { |
| | 12 | 1075 | | if (IsEnabled()) |
| | | 1076 | | { |
| | 0 | 1077 | | WriteEvent(RunOperationExceptionEvent, exception); |
| | | 1078 | | } |
| | 12 | 1079 | | } |
| | | 1080 | | #endregion |
| | | 1081 | | |
| | | 1082 | | #region Client lifecycle |
| | | 1083 | | |
| | | 1084 | | /// <summary> |
| | | 1085 | | /// Indicates that a client is being created, which may correspond to |
| | | 1086 | | /// a <see cref="ServiceBusClient" />, <see cref="ServiceBusSender" />, |
| | | 1087 | | /// or <see cref="ServiceBusReceiver"/>. |
| | | 1088 | | /// </summary> |
| | | 1089 | | /// |
| | | 1090 | | /// <param name="clientType">The type of client being created.</param> |
| | | 1091 | | /// <param name="fullyQualifiedNamespace">The namespace for the client.</param> |
| | | 1092 | | /// <param name="entityName">The entity name for the client.</param> |
| | | 1093 | | [NonEvent] |
| | | 1094 | | public virtual void ClientCreateStart( |
| | | 1095 | | Type clientType, |
| | | 1096 | | string fullyQualifiedNamespace, |
| | | 1097 | | string entityName = default) |
| | | 1098 | | { |
| | 140 | 1099 | | if (IsEnabled()) |
| | | 1100 | | { |
| | 0 | 1101 | | ClientCreateStartCore(clientType.Name, fullyQualifiedNamespace, entityName ?? string.Empty); |
| | | 1102 | | } |
| | 140 | 1103 | | } |
| | | 1104 | | |
| | | 1105 | | [Event(ClientCreateStartEvent, Level = EventLevel.Verbose, Message = "Creating a {0} (Namespace: '{1}', Entity n |
| | | 1106 | | public virtual void ClientCreateStartCore( |
| | | 1107 | | string clientType, |
| | | 1108 | | string fullyQualifiedNamespace, |
| | | 1109 | | string entityName = default) |
| | | 1110 | | { |
| | 0 | 1111 | | if (IsEnabled()) |
| | | 1112 | | { |
| | 0 | 1113 | | WriteEvent(ClientCreateStartEvent, clientType, fullyQualifiedNamespace, entityName); |
| | | 1114 | | } |
| | 0 | 1115 | | } |
| | | 1116 | | |
| | | 1117 | | /// <summary> |
| | | 1118 | | /// Indicates that a client has been created, which may correspond to a |
| | | 1119 | | /// <see cref="ServiceBusClient" />, <see cref="ServiceBusSender" />, or |
| | | 1120 | | /// <see cref="ServiceBusReceiver"/>. |
| | | 1121 | | /// </summary> |
| | | 1122 | | /// |
| | | 1123 | | /// <param name="clientType">The type of client being closed.</param> |
| | | 1124 | | /// <param name="identifier">An identifier to associate with the client.</param> |
| | | 1125 | | /// |
| | | 1126 | | [NonEvent] |
| | | 1127 | | public virtual void ClientCreateComplete( |
| | | 1128 | | Type clientType, |
| | | 1129 | | string identifier) |
| | | 1130 | | { |
| | 116 | 1131 | | if (IsEnabled()) |
| | | 1132 | | { |
| | 0 | 1133 | | ClientCreateCompleteCore(clientType.Name, identifier ?? string.Empty); |
| | | 1134 | | } |
| | 116 | 1135 | | } |
| | | 1136 | | |
| | | 1137 | | [Event(ClientCreateCompleteEvent, Level = EventLevel.Verbose, Message = "A {0} has been created (Identifier '{1} |
| | | 1138 | | public virtual void ClientCreateCompleteCore( |
| | | 1139 | | string clientType, |
| | | 1140 | | string identifier) |
| | | 1141 | | { |
| | 0 | 1142 | | if (IsEnabled()) |
| | | 1143 | | { |
| | 0 | 1144 | | WriteEvent(ClientCreateCompleteEvent, clientType, identifier ?? string.Empty); |
| | | 1145 | | } |
| | 0 | 1146 | | } |
| | | 1147 | | |
| | | 1148 | | /// <summary> |
| | | 1149 | | /// Indicates that an exception was encountered while creating |
| | | 1150 | | /// <see cref="ServiceBusClient" />, <see cref="ServiceBusSender" />, or |
| | | 1151 | | /// <see cref="ServiceBusReceiver"/>. |
| | | 1152 | | /// </summary> |
| | | 1153 | | /// |
| | | 1154 | | /// <param name="clientType">The type of client being closed.</param> |
| | | 1155 | | /// <param name="fullyQualifiedNamespace">The namespace for the client.</param> |
| | | 1156 | | /// <param name="entityPath">The entity path for the client.</param> |
| | | 1157 | | /// <param name="exception">The message for the exception that occurred.</param> |
| | | 1158 | | /// |
| | | 1159 | | [NonEvent] |
| | | 1160 | | public virtual void ClientCreateException( |
| | | 1161 | | Type clientType, |
| | | 1162 | | string fullyQualifiedNamespace, |
| | | 1163 | | string entityPath, |
| | | 1164 | | Exception exception) |
| | | 1165 | | { |
| | 0 | 1166 | | if (IsEnabled()) |
| | | 1167 | | { |
| | 0 | 1168 | | ClientCreateExceptionCore(clientType.Name, fullyQualifiedNamespace, entityPath, exception.ToString()); |
| | | 1169 | | } |
| | 0 | 1170 | | } |
| | | 1171 | | |
| | | 1172 | | [Event(ClientCreateExceptionEvent, Level = EventLevel.Error, Message = "An exception occurred while creating a { |
| | | 1173 | | public virtual void ClientCreateExceptionCore( |
| | | 1174 | | string clientType, |
| | | 1175 | | string fullyQualifiedNamespace, |
| | | 1176 | | string entityPath, |
| | | 1177 | | string exception) |
| | | 1178 | | { |
| | 0 | 1179 | | if (IsEnabled()) |
| | | 1180 | | { |
| | 0 | 1181 | | WriteEvent(ClientCreateExceptionEvent, clientType, fullyQualifiedNamespace, entityPath, exception); |
| | | 1182 | | } |
| | 0 | 1183 | | } |
| | | 1184 | | |
| | | 1185 | | /// <summary> |
| | | 1186 | | /// Indicates that a client is closing, which may correspond to |
| | | 1187 | | /// a <see cref="ServiceBusClient" />, <see cref="ServiceBusSender" />, |
| | | 1188 | | /// or <see cref="ServiceBusReceiver"/>. |
| | | 1189 | | /// </summary> |
| | | 1190 | | /// |
| | | 1191 | | /// <param name="clientType">The type of client being closed.</param> |
| | | 1192 | | /// <param name="identifier">An identifier to associate with the client.</param> |
| | | 1193 | | /// |
| | | 1194 | | [NonEvent] |
| | | 1195 | | public virtual void ClientDisposeStart( |
| | | 1196 | | Type clientType, |
| | | 1197 | | string identifier) |
| | | 1198 | | { |
| | 4 | 1199 | | if (IsEnabled()) |
| | | 1200 | | { |
| | 0 | 1201 | | ClientDisposeStartCore(clientType.Name, identifier ?? string.Empty); |
| | | 1202 | | } |
| | 4 | 1203 | | } |
| | | 1204 | | |
| | | 1205 | | [Event(ClientDisposeStartEvent, Level = EventLevel.Verbose, Message = "Closing a {0} (Identifier '{1}').")] |
| | | 1206 | | public virtual void ClientDisposeStartCore( |
| | | 1207 | | string clientType, |
| | | 1208 | | string identifier) |
| | | 1209 | | { |
| | 0 | 1210 | | if (IsEnabled()) |
| | | 1211 | | { |
| | 0 | 1212 | | WriteEvent(ClientDisposeStartEvent, clientType, identifier); |
| | | 1213 | | } |
| | 0 | 1214 | | } |
| | | 1215 | | |
| | | 1216 | | /// <summary> |
| | | 1217 | | /// Indicates that a client has been closed, which may correspond to an <see cref="ServiceBusConnection" />, |
| | | 1218 | | /// <see cref="ServiceBusSender" />, <see cref="ServiceBusProcessor" />, or <c>EventProcessorClient</c>. |
| | | 1219 | | /// </summary> |
| | | 1220 | | /// |
| | | 1221 | | /// <param name="clientType">The type of client being closed.</param> |
| | | 1222 | | /// <param name="identifier">An identifier to associate with the client.</param> |
| | | 1223 | | /// |
| | | 1224 | | [NonEvent] |
| | | 1225 | | public virtual void ClientDisposeComplete( |
| | | 1226 | | Type clientType, |
| | | 1227 | | string identifier) |
| | | 1228 | | { |
| | 4 | 1229 | | if (IsEnabled()) |
| | | 1230 | | { |
| | 0 | 1231 | | ClientDisposeCompleteCore(clientType.Name, identifier ?? string.Empty); |
| | | 1232 | | } |
| | 4 | 1233 | | } |
| | | 1234 | | |
| | | 1235 | | [Event(ClientDisposeCompleteEvent, Level = EventLevel.Verbose, Message = "A {0} has been closed (Identifier '{1} |
| | | 1236 | | public virtual void ClientDisposeCompleteCore( |
| | | 1237 | | string clientType, |
| | | 1238 | | string identifier) |
| | | 1239 | | { |
| | 0 | 1240 | | if (IsEnabled()) |
| | | 1241 | | { |
| | 0 | 1242 | | WriteEvent(ClientDisposeCompleteEvent, clientType, identifier); |
| | | 1243 | | } |
| | 0 | 1244 | | } |
| | | 1245 | | |
| | | 1246 | | /// <summary> |
| | | 1247 | | /// Indicates that an exception was encountered while closing an <see cref="ServiceBusConnection" />, |
| | | 1248 | | /// <see cref="ServiceBusSender" />, <see cref="ServiceBusProcessor" />, or <c>EventProcessorClient</c>. |
| | | 1249 | | /// </summary> |
| | | 1250 | | /// |
| | | 1251 | | /// <param name="clientType">The type of client being closed.</param> |
| | | 1252 | | /// <param name="identifier">An identifier to associate with the client.</param> |
| | | 1253 | | /// <param name="exception">The message for the exception that occurred.</param> |
| | | 1254 | | /// |
| | | 1255 | | [NonEvent] |
| | | 1256 | | public virtual void ClientDisposeException( |
| | | 1257 | | Type clientType, |
| | | 1258 | | string identifier, |
| | | 1259 | | Exception exception) |
| | | 1260 | | { |
| | 0 | 1261 | | if (IsEnabled()) |
| | | 1262 | | { |
| | 0 | 1263 | | ClientDisposeExceptionCore(clientType.Name, identifier ?? string.Empty, exception.ToString()); |
| | | 1264 | | } |
| | 0 | 1265 | | } |
| | | 1266 | | |
| | | 1267 | | [Event(ClientDisposeExceptionEvent, Level = EventLevel.Error, Message = "An exception occurred while closing a { |
| | | 1268 | | public virtual void ClientDisposeExceptionCore( |
| | | 1269 | | string clientType, |
| | | 1270 | | string identifier, |
| | | 1271 | | string exception) |
| | | 1272 | | { |
| | 0 | 1273 | | if (IsEnabled()) |
| | | 1274 | | { |
| | 0 | 1275 | | WriteEvent(ClientDisposeExceptionEvent, clientType, identifier, exception); |
| | | 1276 | | } |
| | 0 | 1277 | | } |
| | | 1278 | | #endregion |
| | | 1279 | | |
| | | 1280 | | #region transactions |
| | | 1281 | | [Event(TransactionInitializationExceptionEvent, Level = EventLevel.Error, Message = "AmqpTransactionInitializeEx |
| | | 1282 | | public void TransactionInitializeException(string transactionId, string exception) |
| | | 1283 | | { |
| | 0 | 1284 | | if (IsEnabled()) |
| | | 1285 | | { |
| | 0 | 1286 | | WriteEvent(TransactionInitializationExceptionEvent, transactionId, exception); |
| | | 1287 | | } |
| | 0 | 1288 | | } |
| | | 1289 | | |
| | | 1290 | | [NonEvent] |
| | | 1291 | | public void TransactionDeclared(string localTransactionId, ArraySegment<byte> amqpTransactionId) |
| | | 1292 | | { |
| | 0 | 1293 | | if (IsEnabled()) |
| | | 1294 | | { |
| | 0 | 1295 | | TransactionDeclared(localTransactionId, amqpTransactionId.GetAsciiString()); |
| | | 1296 | | } |
| | 0 | 1297 | | } |
| | | 1298 | | |
| | | 1299 | | [Event(TransactionDeclaredEvent, Level = EventLevel.Informational, Message = "AmqpTransactionDeclared for LocalT |
| | | 1300 | | public void TransactionDeclared(string transactionId, string amqpTransactionId) |
| | | 1301 | | { |
| | 0 | 1302 | | WriteEvent(TransactionDeclaredEvent, transactionId, amqpTransactionId); |
| | 0 | 1303 | | } |
| | | 1304 | | |
| | | 1305 | | [NonEvent] |
| | | 1306 | | public void TransactionDischarged(string localTransactionId, ArraySegment<byte> amqpTransactionId, bool rollback |
| | | 1307 | | { |
| | 0 | 1308 | | if (IsEnabled()) |
| | | 1309 | | { |
| | 0 | 1310 | | TransactionDischarged(localTransactionId, amqpTransactionId.GetAsciiString(), rollback); |
| | | 1311 | | } |
| | 0 | 1312 | | } |
| | | 1313 | | |
| | | 1314 | | [Event(TransactionDischargedEvent, Level = EventLevel.Informational, Message = "AmqpTransactionDischarged for Lo |
| | | 1315 | | public void TransactionDischarged(string transactionId, string amqpTransactionId, bool rollback) |
| | | 1316 | | { |
| | 0 | 1317 | | WriteEvent(TransactionDischargedEvent, transactionId, amqpTransactionId, rollback); |
| | 0 | 1318 | | } |
| | | 1319 | | |
| | | 1320 | | [NonEvent] |
| | | 1321 | | public void TransactionDischargeException(string transactionId, ArraySegment<byte> amqpTransactionId, Exception |
| | | 1322 | | { |
| | 0 | 1323 | | if (IsEnabled()) |
| | | 1324 | | { |
| | 0 | 1325 | | TransactionDischargeException(transactionId, amqpTransactionId.GetAsciiString(), exception.ToString()); |
| | | 1326 | | } |
| | 0 | 1327 | | } |
| | | 1328 | | |
| | | 1329 | | [Event(TransactionDischargedExceptionEvent, Level = EventLevel.Error, Message = "AmqpTransactionDischargeExcepti |
| | | 1330 | | public void TransactionDischargeException(string transactionId, string amqpTransactionId, string exception) |
| | | 1331 | | { |
| | 0 | 1332 | | WriteEvent(TransactionDischargedExceptionEvent, transactionId, amqpTransactionId, exception); |
| | 0 | 1333 | | } |
| | | 1334 | | |
| | | 1335 | | [Event(CreateControllerExceptionEvent, Level = EventLevel.Error, Message = "AmqpCreateControllerException for Co |
| | | 1336 | | public void CreateControllerException(string connectionManager, string exception) |
| | | 1337 | | { |
| | 0 | 1338 | | if (IsEnabled()) |
| | | 1339 | | { |
| | 0 | 1340 | | WriteEvent(CreateControllerExceptionEvent, connectionManager, exception); |
| | | 1341 | | } |
| | 0 | 1342 | | } |
| | | 1343 | | #endregion |
| | | 1344 | | |
| | | 1345 | | #region plugins |
| | | 1346 | | [Event(PluginStartEvent, Level = EventLevel.Verbose, Message = "User plugin {0} called on message {1}")] |
| | | 1347 | | public void PluginCallStarted(string pluginName, string messageId) |
| | | 1348 | | { |
| | 0 | 1349 | | if (IsEnabled()) |
| | | 1350 | | { |
| | 0 | 1351 | | WriteEvent(PluginStartEvent, pluginName, messageId); |
| | | 1352 | | } |
| | 0 | 1353 | | } |
| | | 1354 | | |
| | | 1355 | | [Event(PluginCompleteEvent, Level = EventLevel.Verbose, Message = "User plugin {0} completed on message {1}")] |
| | | 1356 | | public void PluginCallCompleted(string pluginName, string messageId) |
| | | 1357 | | { |
| | 0 | 1358 | | if (IsEnabled()) |
| | | 1359 | | { |
| | 0 | 1360 | | WriteEvent(PluginCompleteEvent, pluginName, messageId); |
| | | 1361 | | } |
| | 0 | 1362 | | } |
| | | 1363 | | |
| | | 1364 | | [Event(PluginExceptionEvent, Level = EventLevel.Error, Message = "Exception during {0} plugin execution. Message |
| | | 1365 | | public void PluginCallException(string pluginName, string messageId, string exception) |
| | | 1366 | | { |
| | 0 | 1367 | | if (IsEnabled()) |
| | | 1368 | | { |
| | 0 | 1369 | | WriteEvent(PluginExceptionEvent, pluginName, messageId, exception); |
| | | 1370 | | } |
| | 0 | 1371 | | } |
| | | 1372 | | #endregion |
| | | 1373 | | |
| | | 1374 | | #region misc |
| | | 1375 | | [NonEvent] |
| | | 1376 | | public void ScheduleTaskFailed(Func<Task> task, Exception exception) |
| | | 1377 | | { |
| | 0 | 1378 | | if (IsEnabled()) |
| | | 1379 | | { |
| | 0 | 1380 | | ScheduleTaskFailed(task.Target.GetType().FullName, task.GetMethodInfo().Name, exception.ToString()); |
| | | 1381 | | } |
| | 0 | 1382 | | } |
| | | 1383 | | |
| | | 1384 | | [Event(ScheduleTaskFailedEvent, Level = EventLevel.Error, Message = "Exception during Schedule Task. FunctionTar |
| | | 1385 | | public void ScheduleTaskFailed(string funcTargetName, string methodInfoName, string exception) |
| | | 1386 | | { |
| | 0 | 1387 | | WriteEvent(ScheduleTaskFailedEvent, funcTargetName, methodInfoName, exception); |
| | 0 | 1388 | | } |
| | | 1389 | | |
| | | 1390 | | [Event(ManagementSerializedExceptionEvent, Level = EventLevel.Warning, Message = "[De]Serialization failed for o |
| | | 1391 | | public void ManagementSerializationException(string objectName, string details = "") |
| | | 1392 | | { |
| | 0 | 1393 | | if (IsEnabled()) |
| | | 1394 | | { |
| | 0 | 1395 | | WriteEvent(ManagementSerializedExceptionEvent, objectName, details); |
| | | 1396 | | } |
| | 0 | 1397 | | } |
| | | 1398 | | |
| | | 1399 | | [Event(MaxMessagesExceedsPrefetchEvent, Level = EventLevel.Warning, Message = "Prefetch count for receiver with |
| | | 1400 | | public virtual void MaxMessagesExceedsPrefetch(string identifier, int prefetchCount, int maxMessages) |
| | | 1401 | | { |
| | 0 | 1402 | | if (IsEnabled()) |
| | | 1403 | | { |
| | 0 | 1404 | | WriteEvent(MaxMessagesExceedsPrefetchEvent, identifier, prefetchCount, maxMessages); |
| | | 1405 | | } |
| | 0 | 1406 | | } |
| | | 1407 | | #endregion |
| | | 1408 | | } |
| | | 1409 | | } |