Listen to the .NET MAUI Android Foreground Service #1484
Replies: 2 comments
-
The source below is actually the source of the Windows listen. I tried logging data to logcat in this part, but no events are fired and this part doesn't run at all. My first attempt was to create a notibar and display the data there. I have now deleted that source, so I have listed the windows source instead.
|
Beta Was this translation helpful? Give feedback.
-
No evidence of an issue in this client was provided, this is discussion material. Start with inspecting what RabbitMQ logs. I know nothing about C# on Android but for the Java client, there are several important considerations:
I do not know what a "queue wait count" is. If this is the number of messages ready to be delivered, first order of business is to see if your consumer can registered. Ultimately, a traffic capture will tell you a lot about what both your app and RabbitMQ send and receive. |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
.net maui , create a hybrid services project.
It is ready for .NET8.0.
Prepare a simple foreground service and insert the code mentioned in the sample documentation.
We have successfully connected to the server and when we create a queue, the queue is created , everything is fine.
However, there is no receiving event.
The same code blocks work in C# Blazer Server, C# WindowsForms, etc.
I am looking for a solution to this problem
I have researched many samples, but I haven't found a working rabbit MQ client for MAUI.
Reproduction steps
`var factory = new ConnectionFactory() { HostName = _hostname, UserName = _username, Password = _password };
var connection = factory.CreateConnection();
channel = connection.CreateModel();
// The queue is already ready on the server
// Queue binding Exchange
channel.QueueBind(queue: queueName, exchange: exchangeName, routingKey: "");
var consumer1 = new EventingBasicConsumer(channel);
// Add a message received event handler
consumer1.Received += (model, ea) =>
{
var body = ea.Body.ToArray();
var message = Encoding.UTF8.GetString(body);
MessageReceived?.Invoke(this, message);
};
var consumerTag = channel.BasicConsume(queue: queueName, autoAck: true, consumer: consumer1);
`
Expected behavior
Insert data into an exchange with a C# WindowsForms program and have it sent and received seamlessly when consumed by another program.
In the Android sample, we see that a queue is created.
I verified that the connection is fine.
I'm sure the data is being received, but no events are being fired.
The server does not work on the localhost.
The server is performing services on an authorized IP, and all other programs are seeing connections.
The queue is being accessed in the dashboard, and the queue's wait count is increasing.
(It doesn't seem to be consumed).
If I take data from Maui Android, the queue should decrease, but it does not.
My guess is that the data is not being fetched.
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions