66using Microsoft . ServiceBus . Messaging ;
77using Nimbus . Configuration . LargeMessages . Settings ;
88using Nimbus . Configuration . Settings ;
9- using Nimbus . DependencyResolution ;
109using Nimbus . Extensions ;
1110using Nimbus . Infrastructure . Dispatching ;
12- using Nimbus . Interceptors . Inbound ;
13- using Nimbus . Interceptors . Outbound ;
1411using Nimbus . MessageContracts . Exceptions ;
1512
1613namespace Nimbus . Infrastructure . BrokeredMessageServices
@@ -22,10 +19,8 @@ internal class BrokeredMessageFactory : IBrokeredMessageFactory
2219 private readonly ReplyQueueNameSetting _replyQueueName ;
2320 private readonly IClock _clock ;
2421 private readonly ICompressor _compressor ;
25- private readonly IDependencyResolver _dependencyResolver ;
2622 private readonly IDispatchContextManager _dispatchContextManager ;
2723 private readonly ILargeMessageBodyStore _largeMessageBodyStore ;
28- private readonly IOutboundInterceptorFactory _outboundInterceptorFactory ;
2924 private readonly ISerializer _serializer ;
3025 private readonly ITypeProvider _typeProvider ;
3126
@@ -34,10 +29,8 @@ public BrokeredMessageFactory(MaxLargeMessageSizeSetting maxLargeMessageSize,
3429 ReplyQueueNameSetting replyQueueName ,
3530 IClock clock ,
3631 ICompressor compressor ,
37- IDependencyResolver dependencyResolver ,
3832 IDispatchContextManager dispatchContextManager ,
3933 ILargeMessageBodyStore largeMessageBodyStore ,
40- IOutboundInterceptorFactory outboundInterceptorFactory ,
4134 ISerializer serializer ,
4235 ITypeProvider typeProvider )
4336 {
@@ -46,10 +39,8 @@ public BrokeredMessageFactory(MaxLargeMessageSizeSetting maxLargeMessageSize,
4639 _replyQueueName = replyQueueName ;
4740 _clock = clock ;
4841 _compressor = compressor ;
49- _dependencyResolver = dependencyResolver ;
5042 _dispatchContextManager = dispatchContextManager ;
5143 _largeMessageBodyStore = largeMessageBodyStore ;
52- _outboundInterceptorFactory = outboundInterceptorFactory ;
5344 _serializer = serializer ;
5445 _typeProvider = typeProvider ;
5546 }
@@ -96,15 +87,6 @@ public Task<BrokeredMessage> Create(object serializableObject = null)
9687 // Use the CorrelationId for the current dispatch, otherwise start a new CorrelationId using the message we're sending
9788 brokeredMessage . CorrelationId = currentDispatchContext . CorrelationId ?? brokeredMessage . MessageId ;
9889
99- using ( var scope = _dependencyResolver . CreateChildScope ( ) )
100- {
101- var interceptors = _outboundInterceptorFactory . CreateInterceptors ( scope ) ;
102- foreach ( var interceptor in interceptors )
103- {
104- await interceptor . Decorate ( brokeredMessage , serializableObject ) ;
105- }
106- }
107-
10890 return brokeredMessage ;
10991 } ) ;
11092 }
@@ -182,7 +164,7 @@ public Type GetBodyType(BrokeredMessage message)
182164 var candidates = _typeProvider . AllMessageContractTypes ( ) . Where ( t => t . FullName == typeName ) . ToArray ( ) ;
183165 if ( candidates . Any ( ) == false )
184166 throw new Exception ( "The type '{0}' was not discovered by the type provider and cannot be loaded." . FormatWith ( typeName ) ) ;
185-
167+
186168 // The TypeProvider should not provide a list of duplicates
187169 return candidates . Single ( ) ;
188170 }
0 commit comments