i am developing an android application and i want to broadcast some message to all my clients with RabbitMQ. is there any way wiht RabbitMQ, that supports offline clients - by offline clients I mean that if i have server submitting messages to the clients,and some clients are unreachable,the client will receive messages after it gets connected again.
Is there some open source solution for that? It seems that rabbitMQ does not do this,i might be wrong tho.
Any help would be appreciated.
You can create a unique queue for each client. Bind those queues to a common exchange. Then every time your client will come online it will create a connection to rabbit (earlier defined queue) and will consume messages.
I think you would better benefit from topic exchange (https://www.rabbitmq.com/tutorials/tutorial-five-python.html)
And bind them to a common exchange with desired routing keys.
Related
I Am trying to play with MQTT and RabbitMQ but with some problems.
Introduction
I have several physical machines that generate data and I want to do something with this data, for simplicity imagine that I just want to write those messages to a separate file for each machine identified by an ID. (do not focus on the details, it is just an example)
What I have
I have an MQTT broker (i.e. mosquitto broker) that handles several messages coming from those machines.
I have a (complex) windows service written in C#. An object instantiation exists for each machine (i.e. machine with id = 1000 leads to an object that represents the physical machine in the service program and so on). This machine object has a RabbitMQ queue of messages that contains every message that is delivered by the machine.
The problem
How can I populate this queue?
I thought that there was the possibility, of using the rabbitMQTT plugin, to instantiate an exchange or something similar to listen for the MQTT topics and to forward the received messages to the appropriate queue as usual, but I cannot find anything on the net.
I hope I've been clear enough in proposing the problem that I Am facing.
Assume that I MUST use RabbitMQ since it is already used for the communication of the different modules of the service.
Hope you can help me understand if there is any possibility to use RabbitMQ to listen for messages from an external MQTT broker that I cannot decide on and then push those messages in an exchange that will route the message based on the routing key extracted from the message.
Practical case:
Real-world machine 10000 produces a message A
Real-world machine 10000 publishes on topic machines/10000 the message A
The service (that is subscribed to the machine/# topic) gets the message A
The service publishes message A in the exchange with routing key machines.10000
The machine 10000's callback processes the message A and does something
Thanks, please be as clear as possible since I need to understand the entire process (if possible)
Like the title says.
Is there a way to use gRPC in combination with some kind of message broker/ Queue with .NET?
It does not have to be RabbitMQ. I am open to use alternatives.
\
I want to send messages from 1 client to 2 servers but i need to prevent that the 2 servers process the request at the same time, hence the message queue/broker.
You could do this with Azure Service Bus. Client could be on-premises or in Azure. Same for servers 1 and 2.
Note: You should be able to gRPC to Azure Service Bus, but you may need to use HTTP/REST function for topic/subscription to send messages to Server 1 or 2.
Another approach to consider:
https://grpc.io/blog/grpc-load-balancing/
I think to best answer your question, I assume the reason why you want to use rabbitmq with grpc is because you'd like to have better decoupling from client to servers while still using rpc pattern. With this in mind, this might be something you actually need:
rabbitmq - rpc pattern (could find tutorial from rabbitmq docs)
google protobuf to be your contracts between services
The idea is that client is connected to the queue with two channels, one is to send message where you can specify the destination to be a specific service (in your scenario service1); two is a reply channel where service1 would be sending message back to the client.
Kafka and the confuent platform supports grpc and google proto-buffer as a serialization schema.
We have a messaging application that uses SignalR on a .NET Framework service to connect to clients of various kinds (native mobile + web in the browser). We're looking at potentially replacing SignalR with RabbitMQ to be able to facilitate communication back and forth between the service and various clients in a full duplex fashion. Would this be a viable usecase for RabbitMQ? In the RabbitMQ tutorials I didn't see a specific example that matched. the RPC example is close but it looks like the client initiates the connection, the server gets it, processes it and sends a reply. The connection is blocking from the server side. Is a usecase possible where both the client and the server are producers as well as consumers and they can asynchronously send/receive messages via the queues that they are subscribed to?
I'm not really sure where to ask this, if it's better asked on a different stack exchange please let me know.
my problem is that i am trying to write a program that sends data to clients via wcf.
i have read a lot about it and finally i saw this topic in code project: http://www.codeproject.com/Articles/34333/Topic-based-publish-subscribe-design-pattern-imp
i have implemented it so it will be good to my needs.
the problems are:
i have multiple clients and there is some messages that i need to notify only one client and not all of them.
sometimes i want my client to receive a message from the server,do something and then reply another message to the server
thanks ahead for the help
Set an id for your clients. And then just include id (or id collection) into your messages, so clients can filter messages.
I guess you can develop your client so it can be both publisher and subscriber? Not sure what is the problem here
I am looking for a message broker API to use it with c#.
Normally the things are quite simple. I have a server that knows what jobs are to do and I have some clients that need to get these jobs.
And here are the special requirements I have:
If a client got a job but fails to answer within a specific time, then another client should do the work.
More than one queue and priorities
If possible it needs to work with big message queues (this way I could just load all jobs sometimes a month and forget about it
secured communications would be good.
API for talking with the broker from c#. How much work is done? What is still to do?
Delete some jobs...
If available replication to another broker would be good.
The broker needs to run on windows
What is not an issue:
low latency (there is no problem when a message needs minutes)
Do you know such a message broker that is free to use?
RabbitMQ and several other AMQP implementations satisfy most of (if not all of) these requirements.
RabbitMQ allows clients to acknowledge receipt and/or processing of messages. As per http://www.rabbitmq.com/tutorials/amqp-concepts.html#message-acknowledge:
If a consumer dies without sending an acknowledgement the AMQP broker
will redeliver it to another consumer or, if none are available at the
time, the broker will wait until at least one consumer is registered
for the same queue before attempting redelivery.
Many queues (and in fact many brokers) are supported, in a variety of different configurations
It scales particularly well, even for very large message queues: http://www.rabbitmq.com/faq.html#performance
Encryption is supported: http://www.rabbitmq.com/faq.html#channel-encryption
There is a .NET Client Users Guide and API docs: http://www.rabbitmq.com/documentation.html
There is live failover if a broker dies: http://www.rabbitmq.com/clustering.html
It runs on Windows, Linux, and probably anything else that has an Erlang implementation