Originally, C# was the consumer and Node.js was the producer.
I forced a publish on RabbitMQ, and C# was able to receive.
Node.js was able to send.
- Log in to post comments
Originally, C# was the consumer and Node.js was the producer.
I forced a publish on RabbitMQ, and C# was able to receive.
Node.js was able to send.
public static async Task Main(string[] args)
{
var factory = new ConnectionFactory { HostName = "localhost" };
var connection = await factory.CreateConnectionAsync();
var channel = await connection.CreateChannelAsync();
string queueName = "temperature";
await channel.QueueBindAsync(queueName, "temperature", "temperature.current");
var consumer = new AsyncEventingBasicConsumer(channel);
consumer.ReceivedAsync += async (_, ea) =>
{
var body = ea.Body.ToArray();
var message = Encoding.UTF8.GetString(body);
Console.WriteLine($" [x] Received '{message}'");
};
channel.BasicConsumeAsync(queueName, true, consumer);
while (true)
{
Task.Delay(100);
}
}
External.Messaging.RabbitMQSettings itself has an InitialExpression set, so no other settings are needed.
.png)
When I checked the input data, all the necessary data was entered.
I set it to 5672.
thank you
but, Even if you copy only the production source code and run it locally, the result is the same.
(Instead of using RabbitCreds, I created separate guest credentials.)
.png)
iris - local
rabbitmq - local
And I can connect in C# or NodeJS, but I can't connect in Iris.
I'm using the rabbitmq server I installed earlier.
I configured rabbitmq the same way as in the link.
The username and password remain the same: guest/guest.