A .NET 9 console utility that mail-merges a Handlebars-style JSON template with rows from a CSV file and publishes each resulting message to a RabbitMQ queue over AMQPS.
- .NET 9 SDK
- RabbitMQ broker reachable via AMQPS (port 5671)
Configure the RabbitMq section in appsettings.json (in the same directory as the executable, or project root when developing):
{
"RabbitMq": {
"UserName": "your-user",
"Password": "your-password",
"Host": "rmq.example.com",
"Port": 5671,
"TargetQueue": "your.queue.name"
}
}- UserName, Password, Host, and TargetQueue are required.
- Port defaults to 5671; AMQPS (TLS) is always used.
template.json is a JSON file with placeholders in double curly braces, e.g. {{Id}}, {{Name}}. Placeholder names must match the column headers in your CSV (case-insensitive).
Example:
{
"id": "{{Id}}",
"name": "{{Name}}",
"type": "reactivate"
}data.csv must have a header row; column names should match the template placeholders. Each data row produces one message.
Example:
Id,Name
1,Alice
2,BobFrom the project directory (or where the built executable and appsettings.json live):
# Use default template.json and data.csv in current directory
dotnet run
# Or after publishing:
RmqBlasterOptional arguments (positional):
- Template path – path to the JSON template file (default:
template.json). - CSV path – path to the CSV data file (default:
data.csv).
Examples:
dotnet run -- template.json data.csv
dotnet run -- mytemplate.json mydata.csvThe tool loads config, reads the template and CSV, merges each row into the template, and publishes each JSON message to the configured TargetQueue. Exit code 0 on success; non-zero on error (missing config, missing files, or connection failure).