@@ -33,7 +33,7 @@ public async Task SimpleConsumeMessage()
3333 await context . AcceptAsync ( ) ;
3434 tcs . SetResult ( message ) ;
3535 }
36- ) . BuildAsync ( ) ;
36+ ) . BuildAndStartAsync ( ) ;
3737
3838 await WhenTcsCompletes ( tcs ) ;
3939 IMessage receivedMessage = await tcs . Task ;
@@ -81,7 +81,7 @@ public async Task ConsumerReQueueMessage()
8181 break ;
8282 }
8383 }
84- ) . BuildAsync ( ) ;
84+ ) . BuildAndStartAsync ( ) ;
8585
8686 await WhenTcsCompletes ( tcs ) ;
8787
@@ -136,7 +136,7 @@ async Task MessageHandler(IContext cxt, IMessage msg)
136136 consumer = await _connection . ConsumerBuilder ( )
137137 . Queue ( queueSpec )
138138 . InitialCredits ( initialCredits )
139- . MessageHandler ( MessageHandler ) . BuildAsync ( ) ;
139+ . MessageHandler ( MessageHandler ) . BuildAndStartAsync ( ) ;
140140
141141 await WhenTcsCompletes ( tcs ) ;
142142
@@ -195,7 +195,7 @@ public async Task ConsumerForStreamQueueWithOffset(StreamOffsetSpecification off
195195 . Stream ( )
196196 . Offset ( offset )
197197 . Builder ( )
198- . BuildAsync ( ) ;
198+ . BuildAndStartAsync ( ) ;
199199
200200 // wait for the consumer to consume all messages
201201 // we can't use the TaskCompletionSource here because we don't know how many messages will be consumed
@@ -267,7 +267,7 @@ public async Task ConsumerWithStreamFilterShouldReceiveOnlyPartOfTheMessages(str
267267 . FilterValues ( filters )
268268 . FilterMatchUnfiltered ( false )
269269 . Offset ( StreamOffsetSpecification . First ) . Builder ( )
270- . BuildAsync ( ) ;
270+ . BuildAndStartAsync ( ) ;
271271
272272 int receivedWithoutFilters = 0 ;
273273 IConsumer consumerWithoutFilters = await _connection . ConsumerBuilder ( )
@@ -280,7 +280,7 @@ public async Task ConsumerWithStreamFilterShouldReceiveOnlyPartOfTheMessages(str
280280 } )
281281 . Stream ( )
282282 . Offset ( StreamOffsetSpecification . First ) . Builder ( )
283- . BuildAsync ( ) ;
283+ . BuildAndStartAsync ( ) ;
284284
285285 // wait for the consumer to consume all messages
286286 await Task . Delay ( 500 ) ; // TODO yuck
@@ -326,7 +326,7 @@ public async Task ConsumerForStreamQueueWithOffsetValue(int offsetStart, int num
326326 . Stream ( )
327327 . Offset ( offsetStart )
328328 . Builder ( )
329- . BuildAsync ( ) ;
329+ . BuildAndStartAsync ( ) ;
330330
331331 // wait for the consumer to consume all messages
332332 // we can't use the TaskCompletionSource here because we don't know how many messages will be consumed
@@ -357,7 +357,7 @@ public async Task ConsumerShouldThrowWhenQueueDoesNotExist()
357357 // TODO these are timeout exceptions under the hood, compare
358358 // with the Java client
359359 ConsumerException ex = await Assert . ThrowsAsync < ConsumerException > (
360- ( ) => consumerBuilder . BuildAsync ( ) ) ;
360+ ( ) => consumerBuilder . BuildAndStartAsync ( ) ) ;
361361 Assert . Contains ( doesNotExist , ex . Message ) ;
362362 }
363363
@@ -381,7 +381,7 @@ async Task MessageHandler(IContext cxt, IMessage msg)
381381 IConsumerBuilder consumerBuilder = _connection . ConsumerBuilder ( )
382382 . Queue ( _queueName )
383383 . MessageHandler ( MessageHandler ) ;
384- IConsumer consumer = await consumerBuilder . BuildAsync ( ) ;
384+ IConsumer consumer = await consumerBuilder . BuildAndStartAsync ( ) ;
385385
386386 await PublishAsync ( queueSpecification , 1 ) ;
387387
@@ -426,7 +426,7 @@ public async Task ConsumerUnsettledMessagesGoBackToQueueAfterClosing()
426426 {
427427 receivedGreaterThanSettledTcs . TrySetResult ( true ) ;
428428 }
429- } ) . BuildAsync ( ) ;
429+ } ) . BuildAndStartAsync ( ) ;
430430
431431 await WhenTcsCompletes ( receivedGreaterThanSettledTcs ) ;
432432
@@ -472,7 +472,7 @@ public async Task ConsumerWithHigherPriorityShouldGetMessagesFirst()
472472 allMessagesReceivedTcs . SetException ( ex ) ;
473473 }
474474 } ) ;
475- IConsumer lowPriorityConsumer = await lowPriorityConsumerBuilder . BuildAsync ( ) ;
475+ IConsumer lowPriorityConsumer = await lowPriorityConsumerBuilder . BuildAndStartAsync ( ) ;
476476
477477 IConsumerBuilder highPriorityConsumerBuilder = _connection . ConsumerBuilder ( )
478478 . Queue ( queueSpecification )
@@ -493,7 +493,7 @@ public async Task ConsumerWithHigherPriorityShouldGetMessagesFirst()
493493 allMessagesReceivedTcs . SetException ( ex ) ;
494494 }
495495 } ) ;
496- IConsumer highPriorityConsumer = await highPriorityConsumerBuilder . BuildAsync ( ) ;
496+ IConsumer highPriorityConsumer = await highPriorityConsumerBuilder . BuildAndStartAsync ( ) ;
497497
498498 await PublishAsync ( queueSpecification , messageCount ) ;
499499
0 commit comments