# Azure Service Bus Send/Reply Sample ## Prerequisites An environment variable named `AzureServiceBus_ConnectionString` with the connection string for the Azure Service Bus namespace. ## Code walk-through This sample shows a basic two-endpoint scenario exchanging messages with each other so that: * `Endpoint1` sends a `Message1` message to `Endpoint2`. * `Endpoint2` replies to `Endpoint1` with a `Message2` instance. ### Transport configuration ```cs var endpointConfiguration = new EndpointConfiguration("Samples.ASBS.SendReply.Endpoint1"); endpointConfiguration.EnableInstallers(); var connectionString = Environment.GetEnvironmentVariable("AzureServiceBus_ConnectionString"); if (string.IsNullOrWhiteSpace(connectionString)) { throw new Exception("Could not read the 'AzureServiceBus_ConnectionString' environment variable. Check the sample prerequisites."); } var transport = new AzureServiceBusTransport(connectionString, TopicTopology.Default); endpointConfiguration.UseTransport(transport); endpointConfiguration.UseSerialization(); ``` ## Viewing messages in-flight The following queues for the two endpoints can be seen in the Azure Portal or a third-party tool: * `samples.asbs.sendreply.endpoint1` * `samples.asbs.sendreply.endpoint2` * `error`