I plan to use the Azure Service Bus and SignalR for the chat application. Is it possible to get the history of messages for the period of time? Which type of the Service Bus is most suitable for this (Queues, Topics, Relays)?
Asked
Active
Viewed 2,957 times
1 Answers
4
None. Service Bus messages disappear after Receive and Complete are done.
Have a look at Event Hubs instead. Event Hubs persist events for a given minimum time interval (e.g. 7 or 14 days), so consumers can re-fetch them if needed.
There is no search by time though. If you need indexed granular search, you'd have to copy events to some kind of database, e.g. Cosmos DB.

Mikhail Shilkov
- 34,128
- 3
- 68
- 107
-
Thank you for the answer. I'w read in docs: Event Hubs does not implement some of the capabilities that are available for Service Bus messaging entities, such as topics. How to implement the chat rooms using Event Hub? Can I find examples of chat apps, that working through Event Hub? – Boris Gappov Mar 18 '18 at 19:05
-
1Subscriber of a topic is similar to Consumer Group of an Event Hub. – Mikhail Shilkov Mar 18 '18 at 19:10
-
With Service Bus you can peek at messages which doesn't Complete them, which means they will remain available. You could update the message to say that it has been "read", but don't complete it. Service bus messages can remain for TimeSpan.Max which is slightly more than 10,675,199 days. – Euan Gordon Oct 15 '19 at 10:42