Getting the following error (locally) about a subject id attribute missing but I don’t see any reference to that in the docs. What am I missing?
The full error:
[info] 10:20:11.542 [kalix-akka.actor.default-dispatcher-3] ERROR kalix.javasdk.impl.DiscoveryImpl - Error reported from Kalix system: KLX-00121 An incoming event for the view [UserFollowByFollower] was missing the subject id attribute `ce-subject`, view updates are stalled.
[info] Each update passed to a view must have a subject id, used as a primary key in the view, each unique subject-id can only have one entry in the view, if the update comes from a message broker the subject id is defined with the cloud event attribute [ce-subject].
[info] At com/hiive/user/view/userfollow_byfollower_view.proto:10:1:
[info] service UserFollowByFollower {
[info] option (kalix.codegen) = {
[info] view: {}
[info] };
[info] rpc UpdateUserFollow(domain.UserFollowState) returns (api.UserFollow) {
Here’s the view definition:
syntax = "proto3";
package com.hiive.user.view;
import "google/api/annotations.proto";
import "com/hiive/user/domain/userfollow_domain.proto";
import "com/hiive/user/api/userfollow_api.proto";
import "kalix/annotations.proto";
service UserFollowByFollower {
option (kalix.codegen) = {
view: {}
};
rpc UpdateUserFollow(domain.UserFollowState) returns (api.UserFollow) {
option (kalix.method).eventing.in = {
value_entity: "userfollows"
};
option (kalix.method).view.update = {
table: "userfollows_byfollower_v1"
};
option (google.api.http) = {
post: "/userfollow/byfollower"
body: "*"
};
option (kalix.method).jwt = {
validate: BEARER_TOKEN
};
}
rpc GetUserFollows(UserFollowByFollowerRequest) returns (api.UserFollow) {
option (kalix.method).view.query = {
query: "SELECT * FROM userfollows_byfollower_v1 WHERE followerId = :followerId AND active = true ORDER BY followDatetime DESC"
};
}
}
message UserFollowByFollowerRequest {
string followerId = 1;
}
Here’s the related entity domain definition:
syntax = "proto3";
package com.hiive.user.domain;
import "google/protobuf/timestamp.proto";
message UserFollowState {
string id = 1;
string followerId = 2;
string followedId = 3;
google.protobuf.Timestamp followDatetime = 4;
google.protobuf.Timestamp unfollowDatetime = 5;
bool active = 6;
}
Here’s the related entity api definition:
syntax = "proto3";
package com.hiive.user.api;
import "google/protobuf/empty.proto";
import "kalix/annotations.proto";
import "google/protobuf/timestamp.proto";
service UserFollowService {
option (kalix.codegen) = {
value_entity: {
name: "com.hiive.user.domain.UserFollow"
entity_type: "userfollows"
state: "com.hiive.user.domain.UserFollowState"
}
};
rpc Follow(FollowUserRequest) returns (google.protobuf.Empty) {
option (kalix.method).entity.key_generator = VERSION_4_UUID;
};
rpc Get(GetUserFollowRequest) returns (UserFollow) {}
rpc Unfollow(UnfollowUserRequest) returns (google.protobuf.Empty) {}
}
message UserFollow {
string id = 1 [(kalix.field).entity_key = true];
string followerId = 2;
string followedId = 3;
google.protobuf.Timestamp followDatetime = 4;
google.protobuf.Timestamp unfollowDatetime = 5;
bool active = 6;
}
message FollowUserRequest {
string id = 1;
string followerId = 2;
string followedId = 3;
}
message GetUserFollowRequest {
string id = 1 [(kalix.field).entity_key = true];
}
message UnfollowUserRequest {
string id = 1 [(kalix.field).entity_key = true];
}