@@ -10,10 +10,10 @@ namespace BuslyCLI.Factories;
1010
1111public class RawEndpointFactory : IRawEndpointFactory
1212{
13- public async Task < RawEndpoint > CreateRawEndpoint ( string endpointName , TransportConfig transportConfig )
13+ public async Task < RawEndpoint > CreateRawEndpoint ( string endpointName , TransportConfig transportConfig , bool setupInfrastructure = true )
1414 {
1515 var transport = CreateTransport ( transportConfig ) ;
16- return await InternalCreateEndpoint ( endpointName , transport ) ;
16+ return await InternalCreateEndpoint ( endpointName , transport , setupInfrastructure ) ;
1717 }
1818
1919 public async Task < RawSendOnlyEndpoint > CreateRawSendOnlyEndpoint ( string endpointName , TransportConfig transportConfig )
@@ -148,14 +148,16 @@ private AzureServiceBusTransport CreateAzureServiceBusTransport(string transport
148148
149149 private static async Task < RawEndpoint > InternalCreateEndpoint (
150150 string endpointName ,
151- TransportDefinition transport )
151+ TransportDefinition transport ,
152+ bool setupInfrastructure = true )
152153 {
153154 var infrastructure = await InternalCreateInfrastructure (
154155 endpointName ,
155156 transport ,
156- isReceiveEnabled : true ) ;
157+ isReceiveEnabled : true ,
158+ setupInfrastructure ) ;
157159
158- return new RawEndpoint ( infrastructure ) ;
160+ return new RawEndpoint ( infrastructure , endpointName ) ;
159161 }
160162
161163 private static async Task < RawSendOnlyEndpoint > InternalCreateSendOnlyEndpoint (
@@ -165,15 +167,17 @@ private static async Task<RawSendOnlyEndpoint> InternalCreateSendOnlyEndpoint(
165167 var infrastructure = await InternalCreateInfrastructure (
166168 endpointName ,
167169 transport ,
168- isReceiveEnabled : false ) ;
170+ isReceiveEnabled : false ,
171+ setupInfrastructure : false ) ;
169172
170- return new RawSendOnlyEndpoint ( infrastructure ) ;
173+ return new RawSendOnlyEndpoint ( infrastructure , endpointName ) ;
171174 }
172175
173176 private static async Task < TransportInfrastructure > InternalCreateInfrastructure (
174177 string endpointName ,
175178 TransportDefinition transport ,
176- bool isReceiveEnabled )
179+ bool isReceiveEnabled ,
180+ bool setupInfrastructure )
177181 {
178182 var hostSettings = new HostSettings (
179183 endpointName ,
@@ -183,7 +187,7 @@ private static async Task<TransportInfrastructure> InternalCreateInfrastructure(
183187 {
184188 // Console.WriteLine("Critical error: " + exception);
185189 } ,
186- isReceiveEnabled ) ;
190+ setupInfrastructure ) ;
187191
188192 var infrastructure = await transport . Initialize ( hostSettings ,
189193 isReceiveEnabled
0 commit comments