Re: [akka-user] Dynamically move proxied journal (PersistencePluginProxy) to another node

2016-08-10 Thread Patrik Nordwall
Hi Alexey,

Sorry for the confusion. I mixed up how this works. Do you think we should
add another method to start the target?

  def startJournalPlugin(system: ActorSystem, journalPluginId: String): Unit
  def startSnapshotStorePlugin(system: ActorSystem, snapshotPluginId: String
): Unit

It could live in the PersistencePluginProxy companion object.

Would you like to create a pull request for adding that method?

/Patrik

On Tue, Aug 9, 2016 at 6:33 PM, Alexey S  wrote:

>
>
>>> The problem with the PersistencePluginProxy.start(system) is that AFAIU
>>> it checks the actual actor system config before it decides how exactly to
>>> start the plugin, and if in the config it say "start-target-journal=false"
>>> (as in my case) it won't start the underlying journal.
>>>
>>
>> No, it doesn't. See here: https://github.com/akka/
>> akka/blob/master/akka-persistence/src/main/scala/akka/
>> persistence/journal/PersistencePluginProxy.scala#L26
>>
>> Note that it only works for the default plugin (null). I think there are
>> other places in the PersistencePluginProxy where it only works for the
>> default plugin.
>>
>
> I understand the code you mentioned above as "PersistencePluginProxy only
> works *as* default plugin".
> Otherwise why does it need the target plugin ids config for the journal
> and snapshot?
>
> And this is
> https://github.com/akka/akka/blob/master/akka-persistence/
> src/main/scala/akka/persistence/journal/PersistencePluginProxy.scala#L80
>
> where it decides whether to start the target plugin or not.
>
> Thanks!
>
> WBR,
> Alexey.
>
>
>
>
>
>>
>>
>>>
>>> That's why I'm using that semi-hacky way to force the underlying journal
>>> plugin to start.
>>>
>>> Thanks.
>>>
>>> WBR,
>>> Alexey
>>>
>>> On Sunday, August 7, 2016 at 8:40:19 AM UTC-7, Patrik Nordwall wrote:

 As far as I can see the PersistencePluginProxy can only be used with
 the default journal plugin and then you would use 
 PersistencePluginProxy.sta
 rt(system).

 I hope you need this for testing. PersistencePluginProxy is not
 intended for production usage.

 Regards,
 Patrik

 On Sat, Aug 6, 2016 at 12:46 AM, oleksiys  wrote:

> Hi,
>
> I have a usecase, where I'd like to be able to move the proxied
> journal from one cluster node to another.
> Looks like I can redirect all the journal clients using:
>
> *PersistencePluginProxy.setTargetLocation(someNewLocation)*
>
> But now on the cluster node, that has to host the journal I need to
> actually start the actual journal plugin (considering the default journal
> plugin is proxied-journal).
> So I need a way to start a non-default journal plugin at runtime.
>
> The closest I could get to it was:
>
> *Persistence(system).adaptersFor(journalPluginId)*
>
> it looks a bit hacky, but unfortunately:
>
> *Persistence(system).journalFor(journalPluginId)*
> *Persistence(system).snapshotStoreFor(snapshotStorePluginId)*
>
> are all in the private[akka] scope.
>
> Any suggestions?
>
> Thank you.
>
> WBR,
> Alexey
>
> --
> >> Read the docs: http://akka.io/docs/
> >> Check the FAQ: http://doc.akka.io/docs/akka/c
> urrent/additional/faq.html
> >> Search the archives: https://groups.google.com/grou
> p/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+...@googlegroups.com.
> To post to this group, send email to akka...@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  -  Reactive apps on the JVM
 Twitter: @patriknw

 --
>>> >> Read the docs: http://akka.io/docs/
>>> >> Check the FAQ: http://doc.akka.io/docs/akka/c
>>> urrent/additional/faq.html
>>> >> Search the archives: https://groups.google.com/grou
>>> p/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  -  Reactive apps on the JVM
>> Twitter: @patriknw
>>
>> --
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: http://doc.akka.io/docs/akka/c
>> urrent/additional/

Re: [akka-user] Dynamically move proxied journal (PersistencePluginProxy) to another node

2016-08-09 Thread Alexey S
>
>> The problem with the PersistencePluginProxy.start(system) is that AFAIU
>> it checks the actual actor system config before it decides how exactly to
>> start the plugin, and if in the config it say "start-target-journal=false"
>> (as in my case) it won't start the underlying journal.
>>
>
> No, it doesn't. See here: https://github.com/akka/akka/blob/master/akka-
> persistence/src/main/scala/akka/persistence/journal/
> PersistencePluginProxy.scala#L26
>
> Note that it only works for the default plugin (null). I think there are
> other places in the PersistencePluginProxy where it only works for the
> default plugin.
>

I understand the code you mentioned above as "PersistencePluginProxy only
works *as* default plugin".
Otherwise why does it need the target plugin ids config for the journal and
snapshot?

And this is
https://github.com/akka/akka/blob/master/akka-persistence/src/main/scala/akka/persistence/journal/PersistencePluginProxy.scala#L80

where it decides whether to start the target plugin or not.

Thanks!

WBR,
Alexey.





>
>
>>
>> That's why I'm using that semi-hacky way to force the underlying journal
>> plugin to start.
>>
>> Thanks.
>>
>> WBR,
>> Alexey
>>
>> On Sunday, August 7, 2016 at 8:40:19 AM UTC-7, Patrik Nordwall wrote:
>>>
>>> As far as I can see the PersistencePluginProxy can only be used with the
>>> default journal plugin and then you would use PersistencePluginProxy.sta
>>> rt(system).
>>>
>>> I hope you need this for testing. PersistencePluginProxy is not intended
>>> for production usage.
>>>
>>> Regards,
>>> Patrik
>>>
>>> On Sat, Aug 6, 2016 at 12:46 AM, oleksiys  wrote:
>>>
 Hi,

 I have a usecase, where I'd like to be able to move the proxied journal
 from one cluster node to another.
 Looks like I can redirect all the journal clients using:

 *PersistencePluginProxy.setTargetLocation(someNewLocation)*

 But now on the cluster node, that has to host the journal I need to
 actually start the actual journal plugin (considering the default journal
 plugin is proxied-journal).
 So I need a way to start a non-default journal plugin at runtime.

 The closest I could get to it was:

 *Persistence(system).adaptersFor(journalPluginId)*

 it looks a bit hacky, but unfortunately:

 *Persistence(system).journalFor(journalPluginId)*
 *Persistence(system).snapshotStoreFor(snapshotStorePluginId)*

 are all in the private[akka] scope.

 Any suggestions?

 Thank you.

 WBR,
 Alexey

 --
 >> Read the docs: http://akka.io/docs/
 >> Check the FAQ: http://doc.akka.io/docs/akka/c
 urrent/additional/faq.html
 >> Search the archives: https://groups.google.com/grou
 p/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+...@googlegroups.com.
 To post to this group, send email to akka...@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  -  Reactive apps on the JVM
>>> Twitter: @patriknw
>>>
>>> --
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: http://doc.akka.io/docs/akka/c
>> urrent/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  -  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 a topic in the
> Google Groups "Akka User List" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/akka-user/dVevEhJNKBw/unsubscribe.
> To unsubscribe from this group and all its topics, 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.
>

-- 
>>  Re

Re: [akka-user] Dynamically move proxied journal (PersistencePluginProxy) to another node

2016-08-08 Thread Patrik Nordwall
On Mon, Aug 8, 2016 at 9:13 PM, oleksiys  wrote:

> Hi Patrik,
>
> no, it's not for production, but during testing we'd like to be able to
> shutdown cluster nodes to make sure the app behaves properly.
> In the proxy journal config file I set the "start-target-..." property to
> false for all the nodes and I want to start the target journal only on the
> oldest cluster member, and if/when it dies I want the second oldest cluster
> member to start the target journal plugin etc...
>
> The problem with the PersistencePluginProxy.start(system) is that AFAIU
> it checks the actual actor system config before it decides how exactly to
> start the plugin, and if in the config it say "start-target-journal=false"
> (as in my case) it won't start the underlying journal.
>

No, it doesn't. See here:
https://github.com/akka/akka/blob/master/akka-persistence/src/main/scala/akka/persistence/journal/PersistencePluginProxy.scala#L26

Note that it only works for the default plugin (null). I think there are
other places in the PersistencePluginProxy where it only works for the
default plugin.


>
> That's why I'm using that semi-hacky way to force the underlying journal
> plugin to start.
>
> Thanks.
>
> WBR,
> Alexey
>
> On Sunday, August 7, 2016 at 8:40:19 AM UTC-7, Patrik Nordwall wrote:
>>
>> As far as I can see the PersistencePluginProxy can only be used with the
>> default journal plugin and then you would use PersistencePluginProxy.sta
>> rt(system).
>>
>> I hope you need this for testing. PersistencePluginProxy is not intended
>> for production usage.
>>
>> Regards,
>> Patrik
>>
>> On Sat, Aug 6, 2016 at 12:46 AM, oleksiys  wrote:
>>
>>> Hi,
>>>
>>> I have a usecase, where I'd like to be able to move the proxied journal
>>> from one cluster node to another.
>>> Looks like I can redirect all the journal clients using:
>>>
>>> *PersistencePluginProxy.setTargetLocation(someNewLocation)*
>>>
>>> But now on the cluster node, that has to host the journal I need to
>>> actually start the actual journal plugin (considering the default journal
>>> plugin is proxied-journal).
>>> So I need a way to start a non-default journal plugin at runtime.
>>>
>>> The closest I could get to it was:
>>>
>>> *Persistence(system).adaptersFor(journalPluginId)*
>>>
>>> it looks a bit hacky, but unfortunately:
>>>
>>> *Persistence(system).journalFor(journalPluginId)*
>>> *Persistence(system).snapshotStoreFor(snapshotStorePluginId)*
>>>
>>> are all in the private[akka] scope.
>>>
>>> Any suggestions?
>>>
>>> Thank you.
>>>
>>> WBR,
>>> Alexey
>>>
>>> --
>>> >> Read the docs: http://akka.io/docs/
>>> >> Check the FAQ: http://doc.akka.io/docs/akka/c
>>> urrent/additional/faq.html
>>> >> Search the archives: https://groups.google.com/grou
>>> p/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+...@googlegroups.com.
>>> To post to this group, send email to akka...@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  -  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.
>



-- 

Patrik Nordwall
Akka Tech Lead
Lightbend  -  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.


Re: [akka-user] Dynamically move proxied journal (PersistencePluginProxy) to another node

2016-08-08 Thread oleksiys
Hi Patrik,

no, it's not for production, but during testing we'd like to be able to 
shutdown cluster nodes to make sure the app behaves properly.
In the proxy journal config file I set the "start-target-..." property to 
false for all the nodes and I want to start the target journal only on the 
oldest cluster member, and if/when it dies I want the second oldest cluster 
member to start the target journal plugin etc...

The problem with the PersistencePluginProxy.start(system) is that AFAIU it 
checks the actual actor system config before it decides how exactly to 
start the plugin, and if in the config it say "start-target-journal=false" 
(as in my case) it won't start the underlying journal.

That's why I'm using that semi-hacky way to force the underlying journal 
plugin to start.

Thanks.

WBR,
Alexey

On Sunday, August 7, 2016 at 8:40:19 AM UTC-7, Patrik Nordwall wrote:
>
> As far as I can see the PersistencePluginProxy can only be used with the 
> default journal plugin and then you would 
> use PersistencePluginProxy.start(system).
>
> I hope you need this for testing. PersistencePluginProxy is not intended 
> for production usage.
>
> Regards,
> Patrik
>
> On Sat, Aug 6, 2016 at 12:46 AM, oleksiys > 
> wrote:
>
>> Hi,
>>
>> I have a usecase, where I'd like to be able to move the proxied journal 
>> from one cluster node to another.
>> Looks like I can redirect all the journal clients using:
>>
>> *PersistencePluginProxy.setTargetLocation(someNewLocation)*
>>
>> But now on the cluster node, that has to host the journal I need to 
>> actually start the actual journal plugin (considering the default journal 
>> plugin is proxied-journal).
>> So I need a way to start a non-default journal plugin at runtime.
>>
>> The closest I could get to it was:
>>
>> *Persistence(system).adaptersFor(journalPluginId)*
>>
>> it looks a bit hacky, but unfortunately:
>>
>> *Persistence(system).journalFor(journalPluginId)*
>> *Persistence(system).snapshotStoreFor(snapshotStorePluginId)*
>>
>> are all in the private[akka] scope.
>>
>> Any suggestions?
>>
>> Thank you.
>>
>> WBR,
>> Alexey
>>
>> -- 
>> >> 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+...@googlegroups.com .
>> To post to this group, send email to akka...@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  -  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.


Re: [akka-user] Dynamically move proxied journal (PersistencePluginProxy) to another node

2016-08-07 Thread Patrik Nordwall
As far as I can see the PersistencePluginProxy can only be used with the
default journal plugin and then you would
use PersistencePluginProxy.start(system).

I hope you need this for testing. PersistencePluginProxy is not intended
for production usage.

Regards,
Patrik

On Sat, Aug 6, 2016 at 12:46 AM, oleksiys  wrote:

> Hi,
>
> I have a usecase, where I'd like to be able to move the proxied journal
> from one cluster node to another.
> Looks like I can redirect all the journal clients using:
>
> *PersistencePluginProxy.setTargetLocation(someNewLocation)*
>
> But now on the cluster node, that has to host the journal I need to
> actually start the actual journal plugin (considering the default journal
> plugin is proxied-journal).
> So I need a way to start a non-default journal plugin at runtime.
>
> The closest I could get to it was:
>
> *Persistence(system).adaptersFor(journalPluginId)*
>
> it looks a bit hacky, but unfortunately:
>
> *Persistence(system).journalFor(journalPluginId)*
> *Persistence(system).snapshotStoreFor(snapshotStorePluginId)*
>
> are all in the private[akka] scope.
>
> Any suggestions?
>
> Thank you.
>
> WBR,
> Alexey
>
> --
> >> 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  -  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.


[akka-user] Dynamically move proxied journal (PersistencePluginProxy) to another node

2016-08-05 Thread oleksiys
Hi,

I have a usecase, where I'd like to be able to move the proxied journal 
from one cluster node to another.
Looks like I can redirect all the journal clients using:

*PersistencePluginProxy.setTargetLocation(someNewLocation)*

But now on the cluster node, that has to host the journal I need to 
actually start the actual journal plugin (considering the default journal 
plugin is proxied-journal).
So I need a way to start a non-default journal plugin at runtime.

The closest I could get to it was:

*Persistence(system).adaptersFor(journalPluginId)*

it looks a bit hacky, but unfortunately:

*Persistence(system).journalFor(journalPluginId)*
*Persistence(system).snapshotStoreFor(snapshotStorePluginId)*

are all in the private[akka] scope.

Any suggestions?

Thank you.

WBR,
Alexey

-- 
>>  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.