Closed
Description
Describe the bug
I may be incorrect, but it would appear the wrong client parameters are being passed on creation of StreamSystem. At least I had some difficulties getting it to work while setting up a test and connecting via IP.
Please see this diff:
main...TroelsL:rabbitmq-stream-dotnet-client:fix-endpoint-on-stream-system
Reproduction steps
- Setup a poorly configured RabbitMQ server in host mode networked docker on a remote server, bound to the default interface settings of 0.0.0.0:5552
- Connect to Stream via a config like this:
var config = new StreamSystemConfig
{
Password = "password",
UserName = "user",
Endpoints = new[] { new DnsEndPoint("hostname", 5552) }
};
var system = await StreamSystem.Create(config)!.ConfigureAwait(false);
if (!await system.StreamExists(StreamName).ConfigureAwait(false))
{
await system.CreateStream(new StreamSpec(StreamName)).ConfigureAwait(false);
}
var producerConfig = new ProducerConfig(system, StreamName)
{
};
var producer = await Producer.Create(producerConfig, loggerFactory.CreateLogger<Producer>()).ConfigureAwait(false);
- Observe that it fails to connect as it defaults to the advertised IP (127.0.0.1) endpoint despite having successfully tried and connected to a specific endpoint.
Expected behavior
I would expect the system to connect to the working endpoint over the advertised.
Additional context
No response