static async Task Main(string[] args) { var grpc = GrpcChannel.ForAddress("https://workshop.ursatile.com:5003"); pricerClient = new Pricer.PricerClient(grpc); Console.Write("Subscribing to messages!"); await hub.StartAsync(); bus.Subscribe <NewCarListingMessage>($"newcarpricer", HandleNewCarListing); }
static async Task Main(string[] args) { hub = new HubConnectionBuilder().WithUrl(SIGNALR_URL).Build(); await hub.StartAsync(); await hub.SendAsync("NewCarAlert", "Autobarn.PricingClient", "PricingClient has connected! Yay!"); Console.WriteLine("Sent alert message"); using var grpc = GrpcChannel.ForAddress("https://workshop.ursatile.com:5003"); client = new Pricer.PricerClient(grpc); bus = RabbitHutch.CreateBus(AMQP); bus.PubSub.Subscribe <NewCarMessage>("new-car-logger", HandleNewCarMessage); Console.ReadKey(); }
static async Task Main(string[] args) { customerDatabase = new FakeCustomerDatabase(); using var channel = GrpcChannel.ForAddress(GRPC_URL); grpc = new Pricer.PricerClient(channel); var client = new ServiceBusClient(BUS_CONNECTION_STRING); var processor = client.CreateProcessor(TOPIC, SUBSCRIPTION, new ServiceBusProcessorOptions()); processor.ProcessMessageAsync += ProcessMessage; processor.ProcessErrorAsync += _ => Task.CompletedTask; Console.WriteLine("Waiting for messages. Press any key to exit."); await processor.StartProcessingAsync(); Console.ReadKey(false); await processor.StopProcessingAsync(); }