Subscribe unreliable (3.5)

50 views
Skip to first unread message

Derek den Haas

unread,
Aug 23, 2016, 3:35:03 PM8/23/16
to RavenDB - 2nd generation document database
Sorry to say but having problems with the implementation of Subscriptions to ForDocumentsStartingWith (when server is having problem with memory, it's happening more then when it's having all the memory needed, though it happened 10 times out of 300 events yesterday).

Normally it's working fine, but when it's cleaning up data, it sometimes forgets to fire the observer. I'm using the default implementation, not using Reactive Extensions. Without going through the code (it's pretty simple, print Console.WriteLine() when a document has been "Put"), are there any do's and don'ts using Changes.x.Subscribe?

Maybe helpful to notice, between the two servers is a VPN connection, though it wasn't offline, it might be something to mention.

Kijana Woodard

unread,
Aug 23, 2016, 4:19:49 PM8/23/16
to rav...@googlegroups.com
For clarity, is this using the Changes API or the Data Subscriptions API?

--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Derek den Haas

unread,
Aug 23, 2016, 5:51:29 PM8/23/16
to RavenDB - 2nd generation document database
Changes API, but I see Data Subscriptions is better suited for: "Data subscription provide a reliable and handy way to retrieve documents from the database for processing purposes by application jobs."

Thanks for pointing this out... (Feeling stupid, is exactly what I needed).

Op dinsdag 23 augustus 2016 22:19:49 UTC+2 schreef Kijana Woodard:
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.

Oren Eini (Ayende Rahien)

unread,
Aug 24, 2016, 3:00:27 AM8/24/16
to ravendb
Yes, changes API are meant to do best effort, and there will be disconnection (and missing updates) under high memory situation.
If you need reliability, use Subscriptions.

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Derek den Haas

unread,
Aug 24, 2016, 4:27:01 AM8/24/16
to RavenDB - 2nd generation document database
P.s. also have rare situations when rebooting the Database, that events won't be picked up again. Any ideas on that? Or is that what's suppose to happen?

Op woensdag 24 augustus 2016 09:00:27 UTC+2 schreef Oren Eini:

Oren Eini (Ayende Rahien)

unread,
Aug 24, 2016, 4:56:32 AM8/24/16
to ravendb
It should retry, but it may take a while to pick it up 
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Derek den Haas

unread,
Aug 24, 2016, 6:45:41 AM8/24/16
to RavenDB - 2nd generation document database
Last thing, I'm currently using the suggested Data Subscriptions, and it fetches the documents for me. The only downside (I think) is that changes to the document aren't saved.

Looked at the sourcecode and it appears to be using the YieldStreamResults() which to my knowledge isn't associated with a Session (and therefore cannot call SaveChanges()) is this correct?

I'm always finding it hard to have a result and then having to open a Session again, getting the same document by Id.

P.s. It remains a bit unclear if I should use the same id from Subscriptions -> Create, when adding a second server (WaitForFree) to fetch documents, or that I should create a new subscription and RavenDB will return the same Id (because there is already a subscriber with the same values)?

Op woensdag 24 augustus 2016 10:56:32 UTC+2 schreef Oren Eini:

Oren Eini (Ayende Rahien)

unread,
Aug 24, 2016, 7:29:01 AM8/24/16
to ravendb
You can store the document that the subscription gives you.
session.Store(doc, etag) would work
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages