Reputation: 300
I'm planning to build a web application where users can update some data. Other developers should be able to subscribe to my application via an API and have to be notified if data has changed. With this notification there has to be the changed data sent to the subscriber. The subscribers app then automatically processes the received data.
User changes data
-> My webapps' datastore is being updated
-> Notify all subscribers via REST or something like that over the internet
-> Subscribers process changed data
I'm currently in the planning phase and my problem is which technology to use, to build this notification system.
I don't know the code of the subscribing applications, so the interface between my application and the subscribing application must be something like a REST API.
I thought about using Apache Kafka
or RabbitMQ
to send those messages, but don't know if it's the right way to implement such functionality. I never did this kind of Observer
-pattern between APIs myself.
Do you have any suggestion on this topic?
EDIT: Apache Kafka
and RabbitMQ
were only samples. I'm asking for your suggestions which technology fits best for this situation. It can be a solution without these types of messaging services at all.
Upvotes: 0
Views: 1013
Reputation: 2568
Apache Kafka is based on push and pull based mechanism.Producer push data on a topic and consumer pulls data from that topic.We can defined the poll interval for consumer.
It is not based on observer design pattern. However rest services are available for data ingestion and data consumption which is know as kafka rest proxy.
Like when user data changes , we write those changes on a topic like UserTopic using Producer Rest Service[Kafka Rest Proxy].We have already registered five consumers on topic UserTopic, they will consume the data using Consumer Rest Service[Kafka Rest Proxy].
Upvotes: 1