Analyzing the Twitter 1% Sample Stream in .NET
Add a Twitter App Bearer Token as an environment variable:
Twitter__AppBearerToken=
or secret:
"Twitter:AppBearerToken": ""
- Start the TwitterStreamAnalytics.Api project in Visual Studio.
- Use the Swagger UI that appears to interact with the app.
By design, the Consumers application could be extracted to one or more independent instances supporting high-throughput via the competing consumers pattern. The message bus transport could be swapped from in-memory to a persistent/scalable provider such as RabbitMQ. The Entity Framework Core provider could be swapped from in-memory to a persistent/scalable provider such as Cosmos DB. The app seeks to align with DDD and CQRS patterns to support increasing feature complexity.
flowchart TB;
Api-->SharedKernel.Infrastructure.MessageBus.InMem;
subgraph Message Bus
SharedKernel.Infrastructure.MessageBus.InMem-->N3([MassTransit]);
end
SharedKernel.Infrastructure.MessageBus.InMem-->Api.Application;
SharedKernel.Infrastructure.MessageBus.InMem-->Consumers.Application;
subgraph Api App
Api-->N1([Swashbuckle.AspNetCore]);
Api.Application-->Api.Infrastructure;
Api.Infrastructure-->N4([TweetinviAPI]);
Api.Infrastructure-->N5([MassTransit.Abstractions]);
end
subgraph Consumers App
Consumers.Application-->Consumers.Infrastructure;
Consumers.Infrastructure-->Consumers.Domain;
Consumers.Infrastructure-->N6([MassTransit.Abstractions]);
Consumers.Infrastructure-->N7([Scrutor]);
end
Api.Infrastructure-->SharedKernel.Domain;
Consumers.Domain-->SharedKernel.Domain;
Api.Infrastructure-->SharedKernel.Infrastructure.Persistence.InMem;
Consumers.Infrastructure-->SharedKernel.Infrastructure.Persistence.InMem;
subgraph Persistence
SharedKernel.Infrastructure.Persistence.InMem-->N8([Microsoft.EntityFrameworkCore.InMemory]);
end