Sorry, I'm probably confused. I don't think I've seen a full example of an
Akka Persistence projection, including error handling and saving offsets
persistently. So the infinite stream API seems to be of dubious value
unless you don't care about resilience:

val willNotCompleteTheStreamTagged: Source[EventEnvelope, NotUsed] =
readJournal.eventsByTag("user-added", 0L)

and the one that completes would presumably have to be run in an actor and
re-run if it fails

val willCompleteTheStreamTagged: Source[EventEnvelope, NotUsed] =
readJournal.currentEventsByTag("user-added", 0L)

Anyway, glad all is well from your perspective :)

On Fri, Apr 8, 2016 at 9:19 AM, Patrik Nordwall <patrik.nordw...@gmail.com>
wrote:

>
>
> On Thu, Apr 7, 2016 at 5:17 PM, Richard Rodseth <rrods...@gmail.com>
> wrote:
>
>> Also, seeing the work in reactive-kafka to allow the following, I wonder
>> if this is making you rethink akka-persistence-query APIs
>>
>
> Why? What is wrong? Persistence query api also has an offset parameter
> that can be used as the starting point of the stream.
>
>
>>
>> db.loadOffset().foreach { fromOffset =>
>>     val settings = consumerSettings
>>       .withFromOffset(new TopicPartition("topic1", 1), fromOffset)
>>     Consumer.plainSource(settings)
>>       .mapAsync(1)(db.save)
>>   }
>>
>>
>> On Thu, Apr 7, 2016 at 7:26 AM, Richard Rodseth <rrods...@gmail.com>
>> wrote:
>>
>>> Isn't this section of the docs naïve in the face of possible errors?
>>>
>>>
>>> http://doc.akka.io/docs/akka/current/scala/persistence-query.html#Materialize_view_to_Reactive_Streams_compatible_datastore
>>>
>>> Later on that page is an incomplete example of a resumable projection.
>>> Won't something like that need to be the norm?
>>>
>>>
>>>
>>> On Fri, Feb 26, 2016 at 1:55 PM, Richard Rodseth <rrods...@gmail.com>
>>> wrote:
>>>
>>>> Hmm. I see the fromSequenceNr parameter in the query traits. So the
>>>> read side would have to persist a watermark? Where? I was hoping for less
>>>> boilerplate.
>>>>
>>>> On Fri, Feb 26, 2016 at 5:47 AM, Patrik Nordwall <
>>>> patrik.nordw...@gmail.com> wrote:
>>>>
>>>>>
>>>>>
>>>>> On Wed, Feb 24, 2016 at 10:33 PM, Richard Rodseth <rrods...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> In Vaughn Vernon's Red Book (Implementing DDD) he talks about storing
>>>>>> domain events in the same transaction as the one which updates an
>>>>>> aggregate, and then out of band you read this domain event store (not in
>>>>>> the event sourcing sense)  in order to put messages on a message queue, 
>>>>>> for
>>>>>> example, to notify remote bounded contexts.
>>>>>>
>>>>>> In an akka-cassandra-kafka world, with no transactions, I imagine an
>>>>>> actor with an akka persistence query stream, that is responsible for
>>>>>> putting a domain event on a Kafka topic. In this scenario, would errors
>>>>>> writing to the Kafka topic be handled with retries and ultimately human
>>>>>> intervention? Is the way to add retry semantics to stream computation to
>>>>>> send the stream contents to an actor ref which does the writing?
>>>>>>
>>>>>
>>>>> Easiest would probably be to use akka-persistence-kafka
>>>>> <https://github.com/krasserm/akka-persistence-kafka> as the
>>>>> persistent actor journal, but I think you are asking for something else.
>>>>> Assume that you store the events from the persistent actor to Cassandra,
>>>>> and then have a query to read that stream and put them into Kafka. If the
>>>>> Kafka write fails you have read the events from Cassandra again from the
>>>>> last know successful offset, and try again.
>>>>>
>>>>> /Patrik
>>>>>
>>>>>
>>>>>>
>>>>>> In short: are there any good examples yet of the akka persistence
>>>>>> approach to DDD, including published domain events (which I think are
>>>>>> distinct from raw persistence events).
>>>>>>
>>>>>> --
>>>>>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>> >>>>>>>>>> Check the FAQ:
>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>> >>>>>>>>>> Search the archives:
>>>>>> https://groups.google.com/group/akka-user
>>>>>> ---
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "Akka User List" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to akka-user+unsubscr...@googlegroups.com.
>>>>>> To post to this group, send email to akka-user@googlegroups.com.
>>>>>> Visit this group at https://groups.google.com/group/akka-user.
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> Patrik Nordwall
>>>>> Lightbend <http://www.lightbend.com/> -  Reactive apps on the JVM
>>>>> Twitter: @patriknw
>>>>>
>>>>> [image: Lightbend] <http://www.lightbend.com/>
>>>>>
>>>>> --
>>>>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>> >>>>>>>>>> Check the FAQ:
>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>> >>>>>>>>>> Search the archives:
>>>>> https://groups.google.com/group/akka-user
>>>>> ---
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Akka User List" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to akka-user+unsubscr...@googlegroups.com.
>>>>> To post to this group, send email to akka-user@googlegroups.com.
>>>>> Visit this group at https://groups.google.com/group/akka-user.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>
>> --
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ:
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to akka-user+unsubscr...@googlegroups.com.
>> To post to this group, send email to akka-user@googlegroups.com.
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
>
> Patrik Nordwall
> Akka Tech Lead
> Lightbend <http://www.lightbend.com/> -  Reactive apps on the JVM
> Twitter: @patriknw
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to