safety-data / akka-persistence-redis

Akka persistence plugin for Redis
Apache License 2.0
27 stars 13 forks source link

why is it always looking for localhost ? #25

Closed sahas- closed 5 years ago

sahas- commented 5 years ago

Hi,

Below is my example config, I'm connecting to remote redis server. It successfully connects to remote server, regardless, its always looking for localhost:6379 too and erroring out "connection refused"..

how can I solve this ?

Please point me to documentation, if any.

    akka-persistence-redis {
      redis {
        mode = simple
        host = blah.redislabs.com
        port = 13423
        password = blah
     }
     journal.redis = ${akka-persistence-redis.redis}
   }
satabin commented 5 years ago

Hi, in what file do you overwrite the default redis configuration? reference.conf or application.conf?

sahas- commented 5 years ago

Yes, application.conf

On Tue, Dec 11, 2018, 1:56 AM Lucas Satabin notifications@github.com wrote:

Hi, in what file do you overwrite the default redis configuration? reference.conf or application.conf?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/safety-data/akka-persistence-redis/issues/25#issuecomment-446105893, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ4bVdoEmzKn0Z6mvw_huikpZWfoW7CWks5u32UdgaJpZM4ZMmXE .

satabin commented 5 years ago

Can you then provide me with the stacktrace of the exception please?

satabin commented 5 years ago

Other questions:

sahas- commented 5 years ago

I use both journal and snapshot. It connects to remote redis fine but doesn't stop there, continuously trying to connect to local redis too and retrying every 2 seconds.

I'll get the stack later tonight.

On Tue, Dec 11, 2018, 6:54 AM Lucas Satabin notifications@github.com wrote:

Other questions:

  • Do you use the snapshot part?
  • Do you use the read-journal part?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/safety-data/akka-persistence-redis/issues/25#issuecomment-446192439, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ4bVUI1xhOhtI6XPsj_XMWn2oNwHY1Tks5u36sZgaJpZM4ZMmXE .

satabin commented 5 years ago

You also need to override the snapshot redis part then, the same way you did for journal:

akka-persistence-redis.snapshot.redis = ${akka-persistence-redis.redis}

This is due to the way typesafe config merges objects (first all reference.conf files are merged, then application.conf, but refeerences are not updated).

sahas- commented 5 years ago

Ah. it worked. Thank you