How to return an array in Protobuf service rpc

Option 1 - Use stream:

rpc GetItems (ItemsQuery) returns (stream Item) {
}

Option 2 - Set a response message which will use a repeated object:

service MyService {
    rpc GetItem (ItemQuery) returns (ItemResponse) {
    }
}

message ItemQuery {
    int id = 1;
}
message ItemResponse {
    repeated Item items = 1;
}
message Item {
    int id = 1;
    string name = 2;
}