Invalid content-type Error while performing Service to Service Eventing

Initially I got the below log in the subscriber when I ran two services:

“logger”:“kalix.javasdk.impl.DiscoveryImpl”,“message”:“Warning reported from Kalix system: KLX-00426 Direct eventing in service [host.docker.internal:9000] is failing, will be retried\n\nCould not connect to [host.docker.internal:9000]”,“context”:“default”,“severity”:“WARN”}

And Below is the error when I tried to publish an event from one service to other(subscriber).

“logger”:“kalix.javasdk.impl.DiscoveryImpl”,“message”:“Warning reported from Kalix system: KLX-00426 Direct eventing in service [host.docker.internal:9000] is failing, will be retried\n\nHTTP status code 404\ninvalid content-type: null\ntrailers: Metadata(:status=404,date=Mon, 24 Apr 2023 10:39:05 GMT,server=akka-http/10.5.0,content-length=0)”,“context”:“default”,“severity”:“WARN”

Here I am publishing a Json payload to the subscriber. Do we need to set any content type explicitly? Please help me to fix this

Running two services locally requires some extra work, especially if you want to run two services with service to service eventing in between. I’d recommend that you take a look at the two samples:

Or the corresponding two Java samples and how they are set up to use different ports in their builds and docker-compose.yml files.

As a side note we are currently working on making running multiple servies locally for development easier, so this will soon be less tricky to get right.