Service to service eventing error

this is the view definition
service IncomingConnectionStreamView {
option (kalix.codegen) = {
view: {}
};
option (kalix.service).eventing.in.direct = {
service: “host.docker.internal:9002”
event_stream_id: “connection_events”
};
rpc HandleLinkGcmConnectionReceived(AwaitingGCMConnectionNumberValidationEvent) returns (Connection) {
option (kalix.method).view.update = {
table: “connection”
transform_updates: true
};
}

rpc HandleNewDealEvent(NewDealEvent) returns (Deal) {
option (kalix.method).eventing.in = {
event_sourced_entity: “deal”
};
option (kalix.method).view.update = {
table: “deal”
transform_updates: true
};
}

rpc getDealConnections(ValidDealConnectionIdRequest) returns (DealConnection) {
option (kalix.method).view.query = {
query: "SELECT * FROM connection "
“JOIN deal on deal.deal_connections.connection_id = connection.connection_id WHERE deal.deal_id = :deal_id”
};
option (google.api.http) = {
get: “/deal/getDealById”
};
}
}

but I get the following error
2023-09-12 20:40:58,194 ERROR k.j.i.DiscoveryImpl [kalix-akka.actor.default-dispatcher-4 ] - Error reported from Kalix system: KLX-00422 Service level and method level eventing cannot be combined.

Update descriptor to use either service level eventing in options or method level options.

this used to work with 1.1.7 but our kalix version is latest now

What the error means is that you have to either use option (kalix.service).eventing.in.direct for the entire service, or for the individual update methods. Just like the error says, you have annotations both on the service level and on the HandleNewDealEvent method.

Since the service to service annotation can only be on service level, you would have to move the event sourced entity one there as well. It should automatically map the event types from the event sourced entity to the right update method.

The validation logic for this has not changed since the service to service eventing was introduced in proxy v1.0.21, so that service descriptor should always have given you the same validation error.

As you suggested, I moved everything to method level and it stopped throwing error

rpc HandleLinkGcmConnectionReceived(AwaitingGCMConnectionNumberValidationEvent) returns (Connection) {
option (kalix.method).eventing.in.direct = {
service: “host.docker.internal:9002”
event_stream_id: “connection_events”
};
option (kalix.method).view.update = {
table: “connection”
transform_updates: true
};
}