I am working on an HTTP/HTTPS listener which basically listens to the ActiveMQ REST endpoint to get the latest messages. If we use a C# library like Apache.NMS then it's using TCP/IP to get notified about the new messages in ActiveMQ. I need the same notification/callback behavior while working with ActiveMQ REST endpoints.
Does anybody have any idea on how to constantly listen to ActiveMQ REST endpoint with some HTTP listener and get notified about new messages? I don't want to use polling (e.g. like calling the ActiveMQ REST API every 5-10 seconds).
The ActiveMQ 5.x REST interface doesn't support callbacks of any sort so your only option is to poll. The reason an NMS client gets "notified" about messages is because that's the way it's written. It creates and holds a connection to the broker through which the broker can dispatch messages to it. HTTP just isn't suited to this task.
Generally speaking REST isn't a great solution for messaging specifically due to the lack of callback functionality. I'd recommend using something like STOMP which is simple and ubiquitous. Also, there is no standard for REST messaging. If you write your application to work with ActiveMQ 5.x's REST interface then your application will be tied to ActiveMQ 5.x. It won't work with any other broker. However, lots of brokers support STOMP.