-
Notifications
You must be signed in to change notification settings - Fork 48
[SPIKE] Add LavinMQ version and extra connection requirement - DO NOT MERGE #4838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ namespace ServiceControl.Transports.RabbitMQ; | |
| using System.Linq; | ||
| using System.Net; | ||
| using System.Net.Http; | ||
| using System.Net.Http.Headers; | ||
| using System.Net.Http.Json; | ||
| using System.Runtime.CompilerServices; | ||
| using System.Text.Json; | ||
|
|
@@ -93,6 +94,8 @@ protected override void InitializeCore(ReadOnlyDictionary<string, string> settin | |
| // so for now we are using a virtual method that can be overriden in tests | ||
| // https://github.com/Particular/ServiceControl/issues/4493 | ||
| httpClient = CreateHttpClient(defaultCredential, apiUrl); | ||
| var authToken = Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes($"{username}:{password}")); | ||
| httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authToken); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -154,7 +157,7 @@ public override async IAsyncEnumerable<QueueThroughput> GetThroughputPerDay(IBro | |
| throw new Exception("The RabbitMQ broker is configured with 'management.disable_stats = true' or 'management_agent.disable_metrics_collector = true' and as a result queue statistics cannot be collected using this tool. Consider changing the configuration of the RabbitMQ broker."); | ||
| } | ||
|
|
||
| var rabbitVersion = obj["rabbitmq_version"] ?? obj["product_version"]; | ||
| var rabbitVersion = obj["rabbitmq_version"] ?? obj["product_version"] ?? obj["lavinmq_version"]; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this report the LavinMQ version number as the RabbitMQ version in the broker metadata? I'm not sure that's what we want to do. Shouldn't we identify it's actually LavinMQ and not RabbitMQ somehow?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At this stage - this is just a spike. It is all "wrong" as the transport is rabbitmq and all docs etc, including SP display will say rabbitmq |
||
| var mgmtVersion = obj["management_version"]; | ||
|
|
||
| return (rabbitVersion?.GetValue<string>() ?? "Unknown", mgmtVersion?.GetValue<string>() ?? "Unknown"); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sends the credentials in plain text which is not what we want and we would want to change this.
Using
PreAuthenticate = true,on the httpclient instead of setting this header directly does not work.