Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
b3c8903
WIP
nblumhardt Feb 4, 2019
1025d3d
Don't package Serilog/Apps dlls
nblumhardt Feb 4, 2019
76dfa62
Working!
nblumhardt Feb 4, 2019
f65f0a9
Update LICENSE to include information about packaged components
nblumhardt Feb 5, 2019
fa27d9c
Update README.md
nblumhardt Feb 5, 2019
c19e1d7
Update README.md
nblumhardt Feb 5, 2019
03dcce1
Remove redundant <PackageLicenseUrl>
nblumhardt Feb 5, 2019
abe7bc3
Update build badge [skip ci]
nblumhardt Feb 5, 2019
c9c601f
Fix NuGet.org publishing key
nblumhardt Feb 5, 2019
d0aeb87
More README [skip ci]
nblumhardt Feb 5, 2019
9306214
Note required Seq version [skip ci]
nblumhardt Feb 5, 2019
52fa109
Added RabbitMQVHost
erictummers Feb 9, 2023
2e5c463
Added rabbitMQVHost to the constructor
erictummers Feb 9, 2023
e3c9879
added IsSsl
erictummers Feb 10, 2023
b5a9c1a
Added IsSsl handling
erictummers Feb 10, 2023
c0afcf5
updated rabbitmq client to 6.4
erictummers Feb 10, 2023
455c101
Byte array to string with Encoding.UTF8
erictummers Feb 10, 2023
f61e92a
Seq.Apps version bump
erictummers Feb 10, 2023
0527e69
Update display name and helptext for clarity
erictummers Feb 11, 2023
1edc37b
Private class and comment for bad practice
erictummers Feb 11, 2023
7cc7473
Drop out SSL policy configuration
nblumhardt Feb 13, 2023
8a32846
Merge branch 'erictummers-dev' into dev
nblumhardt Feb 13, 2023
e192c37
Update Build.ps1
nblumhardt Feb 13, 2023
e877a84
Update publishing info
nblumhardt Feb 13, 2023
85e6fa6
Added dlx parameter.
antoniaelek Jan 16, 2025
ee28cea
port to GitHub Actions
KodrAus Jan 20, 2025
d194181
try running CI on ubuntu
KodrAus Jan 21, 2025
15f43af
add version props
KodrAus Jan 21, 2025
9158d6a
remove stubbed test project
KodrAus Jan 21, 2025
92b49fc
more project updates
KodrAus Jan 21, 2025
3969e43
make test running conditional
KodrAus Jan 21, 2025
a61fb1f
update build badge
KodrAus Jan 21, 2025
7f6b505
Merge pull request #9 from datalust/ci/actions
KodrAus Jan 21, 2025
6822068
Update src/Seq.Input.RabbitMQ/RabbitMQInput.cs
antoniaelek Jan 28, 2025
ca6425b
Remove default value for Dlx parameter.
antoniaelek Jan 30, 2025
6619f9f
Merge pull request #7 from antoniaelek/feature/dlx
KodrAus Jan 31, 2025
b3fcf6e
Update to RabbitMQ.Client 7, lift other dependency versions
nblumhardt Nov 10, 2025
e6843e4
Update demo client
nblumhardt Nov 10, 2025
fc15b4f
Merge pull request #11 from datalust/update-to-rmq7
nblumhardt Nov 10, 2025
66468a2
Fix packaging regression caused by earlier build script migration
nblumhardt Nov 11, 2025
580a4d4
Merge pull request #12 from datalust/packaging-fix
nblumhardt Nov 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Auto detect text files and perform LF normalization

* text=auto
*.sh text eol=lf
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# If this file is renamed, the incrementing run attempt number will be reset.

name: CI

on:
push:
branches: [ "dev", "main" ]
pull_request:
branches: [ "dev", "main" ]

env:
CI_BUILD_NUMBER_BASE: ${{ github.run_number }}
CI_TARGET_BRANCH: ${{ github.head_ref || github.ref_name }}

jobs:
build:

runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/checkout@v4
- name: Setup
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Compute build number
shell: bash
run: |
echo "CI_BUILD_NUMBER=$(($CI_BUILD_NUMBER_BASE+2300))" >> $GITHUB_ENV
- name: Build and Publish
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: pwsh
run: |
./Build.ps1
80 changes: 80 additions & 0 deletions Build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
Write-Output "build: Tool versions follow"

dotnet --version
dotnet --list-sdks

Write-Output "build: Build started"

Push-Location $PSScriptRoot
try {
if(Test-Path .\artifacts) {
Write-Output "build: Cleaning ./artifacts"
Remove-Item ./artifacts -Force -Recurse
}

& dotnet restore --no-cache

$dbp = [Xml] (Get-Content .\Directory.Version.props)
$versionPrefix = $dbp.Project.PropertyGroup.VersionPrefix

Write-Output "build: Package version prefix is $versionPrefix"

$branch = @{ $true = $env:CI_TARGET_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$NULL -ne $env:CI_TARGET_BRANCH];
$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:CI_BUILD_NUMBER, 10); $false = "local" }[$NULL -ne $env:CI_BUILD_NUMBER];
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)) -replace '([^a-zA-Z0-9\-]*)', '')-$revision"}[$branch -eq "main" -and $revision -ne "local"]
$commitHash = $(git rev-parse --short HEAD)
$buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""]

Write-Output "build: Package version suffix is $suffix"
Write-Output "build: Build version suffix is $buildSuffix"

foreach ($src in Get-ChildItem src/*) {
Push-Location $src

Write-Output "build: Packaging project in $src"

if ($suffix) {
& dotnet publish -c Release -o ./obj/publish --version-suffix=$buildSuffix /p:ContinuousIntegrationBuild=true
& dotnet pack -c Release -o ../../artifacts --no-build --version-suffix=$suffix
} else {
& dotnet publish -c Release -o ./obj/publish /p:ContinuousIntegrationBuild=true
& dotnet pack -c Release -o ../../artifacts --no-build
}
if($LASTEXITCODE -ne 0) { throw "Packaging failed" }

Pop-Location
}

if(Test-Path .\test) {
foreach ($test in Get-ChildItem test/*.Tests) {
Push-Location $test

Write-Output "build: Testing project in $test"

& dotnet test -c Release --no-build --no-restore
if($LASTEXITCODE -ne 0) { throw "Testing failed" }

Pop-Location
}
}

if ($env:NUGET_API_KEY) {
# GitHub Actions will only supply this to branch builds and not PRs. We publish
# builds from any branch this action targets (i.e. main and dev).

Write-Output "build: Publishing NuGet packages"

foreach ($nupkg in Get-ChildItem artifacts/*.nupkg) {
& dotnet nuget push -k $env:NUGET_API_KEY -s https://api.nuget.org/v3/index.json "$nupkg"
if($LASTEXITCODE -ne 0) { throw "Publishing failed" }
}

if (!($suffix)) {
Write-Output "build: Creating release for version $versionPrefix"

iex "gh release create v$versionPrefix --title v$versionPrefix --generate-notes $(get-item ./artifacts/*.nupkg) $(get-item ./artifacts/*.snupkg)"
}
}
} finally {
Pop-Location
}
5 changes: 5 additions & 0 deletions Directory.Version.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<VersionPrefix>1.0.0</VersionPrefix>
</PropertyGroup>
</Project>
17 changes: 17 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
Seq.Input.RabbitMQ is Copyright (c) 2019 Datalust Pty Ltd and Contributors,
provided subject to the Apache License, Version 2.0.

The Seq.Input.RabbitMQ NuGet package includes binary components licensed by
their respective copyright owners, including but not limited to:

* .NET CoreFX components (System.*.dll) - MIT License,
https://github.com/dotnet/corefx/blob/master/LICENSE.TXT

* Microsoft .NET libraries (System.*.dll) - MS-.NET-Library License,
https://dotnet.microsoft.com/dotnet_library_license.htm

* RabbitMQ.Client.dll - Apache 2.0 license,
http://www.rabbitmq.com/dotnet.html

---

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Expand Down
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
# seq-input-rabbitmq
An example Seq custom input that pulls events from RabbitMQ
# Seq.Input.RabbitMQ [![CI](https://github.com/datalust/seq-input-rabbitmq/actions/workflows/ci.yml/badge.svg)](https://github.com/datalust/seq-input-rabbitmq/actions/workflows/ci.yml)

A Seq custom input that pulls events from RabbitMQ. **Requires Seq 2025.2+.**

### Getting started

The app is published to NuGet as [_Seq.Input.RabbitMQ_](https://nuget.org/packages/seq.input.rabbitmq). Follow the instructions for [installing a Seq App](https://docs.getseq.net/docs/installing-seq-apps) and start an instance of the app, providing your RabbitMQ server details.

### Sending events to the input

The input accepts events in [compact JSON format](https://github.com/serilog/serilog-formatting-compact#format-details), encoded as UTF-8 text.

The [_Serilog.Sinks.RabbitMQ_ sink](https://github.com/sonicjolt/serilog-sinks-rabbitmq), along with the [_Serilog.Formatting.Compact_ formatter](https://github.com/serilog/serilog-formatting-compact), can be used for this.

See the _Demo_ project included in the repository for an example of client configuration that works with the default input configuration.
Binary file added asset/seq-input-rabbitmq.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions example/Demo/Demo.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Serilog" Version="4.3.0" />
<PackageReference Include="Serilog.Sinks.RabbitMQ" Version="8.0.0" />
<PackageReference Include="Serilog.Formatting.Compact" Version="3.0.0" />
</ItemGroup>

</Project>
22 changes: 22 additions & 0 deletions example/Demo/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System.Threading;
using Serilog;
using Serilog.Formatting.Compact;

Log.Logger = new LoggerConfiguration()
.Enrich.WithProperty("Application", "Demo")
.WriteTo.RabbitMQ((client, sink) =>
{
client.Hostnames.Add("localhost");
client.Username = "guest";
client.Password = "guest";
client.Exchange = "";
client.RoutingKey = "logs";
sink.TextFormatter = new CompactJsonFormatter();
})
.CreateLogger();

while (true)
{
Log.Information("Yo, RabbitMQ!");
Thread.Sleep(1000);
}
46 changes: 46 additions & 0 deletions seq-input-rabbitmq.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.102
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sln", "sln", "{7D1D14F7-D40D-43EB-8CC0-04B555758178}"
ProjectSection(SolutionItems) = preProject
Build.ps1 = Build.ps1
LICENSE = LICENSE
README.md = README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{704915B0-6D95-4CF8-ACC2-5ED939A2913C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Seq.Input.RabbitMQ", "src\Seq.Input.RabbitMQ\Seq.Input.RabbitMQ.csproj", "{E80E7949-A3AE-4C7C-9083-9FE9EE1F78E0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "example", "example", "{584683E5-0578-42F0-A958-3AAB3661AA9E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo", "example\Demo\Demo.csproj", "{99D4AAE3-35B3-4BE1-AA5F-7CC8E6B49A07}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E80E7949-A3AE-4C7C-9083-9FE9EE1F78E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E80E7949-A3AE-4C7C-9083-9FE9EE1F78E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E80E7949-A3AE-4C7C-9083-9FE9EE1F78E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E80E7949-A3AE-4C7C-9083-9FE9EE1F78E0}.Release|Any CPU.Build.0 = Release|Any CPU
{99D4AAE3-35B3-4BE1-AA5F-7CC8E6B49A07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{99D4AAE3-35B3-4BE1-AA5F-7CC8E6B49A07}.Debug|Any CPU.Build.0 = Debug|Any CPU
{99D4AAE3-35B3-4BE1-AA5F-7CC8E6B49A07}.Release|Any CPU.ActiveCfg = Release|Any CPU
{99D4AAE3-35B3-4BE1-AA5F-7CC8E6B49A07}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{E80E7949-A3AE-4C7C-9083-9FE9EE1F78E0} = {704915B0-6D95-4CF8-ACC2-5ED939A2913C}
{99D4AAE3-35B3-4BE1-AA5F-7CC8E6B49A07} = {584683E5-0578-42F0-A958-3AAB3661AA9E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2DD287FB-EAAA-422B-BA1E-B1C91CCC0100}
EndGlobalSection
EndGlobal
2 changes: 2 additions & 0 deletions seq-input-rabbitmq.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MQV/@EntryIndexedValue">MQV</s:String></wpf:ResourceDictionary>
Loading