Search code examples
scalaakkamicroservices

How to change akka-scala response model without breaking existing setup


I have a service A which is used by multiple microservices (internal) via a client package from this service A which includes models for MyRequest, MyResponse etc. We are using akka-scala actors, on client akka ask? pattern is used. This is the current system.

Now I want to add a attribute x in case class MyResponse(a: Int, b: String, x: Option[String] = None). But when I deployed it, the services with old client stopped working and not receiving anything from service A. I want to push this change to be in non-breaking way since it is being used by multiple services, its not possible to update all of them at once. For this I have already added default value for x.

Need help in figuring out what is wrong here and what is the best way to publish changes like these with akka system?


Solution

  • Just for my understanding : You have Server A with case class MyResponse(a: Int, b: String) and Server B with MyResponse(a: Int, b: String, x: Option[String] = None)? If so it sound like it's not the same message... Server B send To Server A message it can't process (if so it will get to the dead letter Q)

    If B send to A this should be the deploy steps : 1. deploy server A the new message with support for it 2. deploy server B the new message and start using it 3. delete message from server B 4.delete message from server A