Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proto marshalling is failing with using latest protoc-gen-go and protoc #282

Open
shi-rudo opened this issue Apr 21, 2022 · 3 comments
Open

Comments

@shi-rudo
Copy link

shi-rudo commented Apr 21, 2022

I wanted to try out the example of "5-cqrs-protobuf". On recreating the events.pb.go the example watermill fails with:

[watermill] 2022/04/21 10:52:50.101794 router.go:603:     level=ERROR msg="Handler returned error" err="1 error occurred:
golang_1    |   * panic occurred: "protobuf tag not enough fields in BookRoom.state: "

repo for reproducing can be found under: https://github.com/shi-rudo/5-cqrs-protobuf-latest

// versions:
// protoc-gen-go v1.28.0
// protoc v3.19.4

[watermill] 2022/04/21 10:52:50.101794 router.go:603:     level=ERROR msg="Handler returned error" err="1 error occurred:
golang_1    |   * panic occurred: "protobuf tag not enough fields in BookRoom.state: ", stacktrace: 
golang_1    | goroutine 823 [running]:
golang_1    | runtime/debug.Stack()
golang_1    |   /usr/local/go/src/runtime/debug/stack.go:24 +0x88
golang_1    | github.com/ThreeDotsLabs/watermill/message/router/middleware.Recoverer.func1.1(0x4000497f38)
golang_1    |   /go/pkg/mod/github.com/!three!dots!labs/[email protected]/message/router/middleware/recoverer.go:27 +0x48
golang_1    | panic({0x35a360, 0x4000192210})
golang_1    |   /usr/local/go/src/runtime/panic.go:1038 +0x224
golang_1    | github.com/gogo/protobuf/proto.(*unmarshalInfo).computeUnmarshalInfo(0x40002ae000)
golang_1    |   /go/pkg/mod/github.com/gogo/[email protected]/proto/table_unmarshal.go:341 +0x12fc
golang_1    | github.com/gogo/protobuf/proto.(*unmarshalInfo).unmarshal(0x40002ae000, {0x4000328060}, {0x40000a0270, 0x25, 0x25})
golang_1    |   /go/pkg/mod/github.com/gogo/[email protected]/proto/table_unmarshal.go:138 +0x40
golang_1    | github.com/gogo/protobuf/proto.(*InternalMessageInfo).Unmarshal(0x400048c020, {0xffff82478080, 0x4000328060}, {0x40000a0270, 0x25, 0x25})
golang_1    |   /go/pkg/mod/github.com/gogo/[email protected]/proto/table_unmarshal.go:63 +0xd0
golang_1    | github.com/gogo/protobuf/proto.(*Buffer).Unmarshal(0x4000497d30, {0xffff82478080, 0x4000328060})
golang_1    |   /go/pkg/mod/github.com/gogo/[email protected]/proto/decode.go:424 +0x1bc
golang_1    | github.com/gogo/protobuf/proto.Unmarshal({0x40000a0270, 0x25, 0x25}, {0xffff82478080, 0x4000328060})
golang_1    |   /go/pkg/mod/github.com/gogo/[email protected]/proto/decode.go:342 +0x108
golang_1    | github.com/ThreeDotsLabs/watermill/components/cqrs.ProtobufMarshaler.Unmarshal(...)
golang_1    |   /go/pkg/mod/github.com/!three!dots!labs/[email protected]/components/cqrs/marshaler_protobuf.go:61
golang_1    | github.com/ThreeDotsLabs/watermill/components/cqrs.CommandProcessor.routerHandlerFunc.func1(0x4000328000)
golang_1    |   /go/pkg/mod/github.com/!three!dots!labs/[email protected]/components/cqrs/command_processor.go:163 +0x404
golang_1    | github.com/ThreeDotsLabs/watermill/message.(*Router).AddNoPublisherHandler.func1(0x4000328000)
golang_1    |   /go/pkg/mod/github.com/!three!dots!labs/[email protected]/message/router.go:284 +0x30
golang_1    | github.com/ThreeDotsLabs/watermill/message/router/middleware.Recoverer.func1(0x4000328000)
golang_1    |   /go/pkg/mod/github.com/!three!dots!labs/[email protected]/message/router/middleware/recoverer.go:32 +0x64
golang_1    | github.com/ThreeDotsLabs/watermill/message.(*handler).handleMessage(0x4000214000, 0x4000328000, 0x4000192550)
golang_1    |   /go/pkg/mod/github.com/!three!dots!labs/[email protected]/message/router.go:601 +0x158
golang_1    | created by github.com/ThreeDotsLabs/watermill/message.(*handler).run
golang_1    |   /go/pkg/mod/github.com/!three!dots!labs/[email protected]/message/router.go:472 +0x2a0

https://github.com/shi-rudo/5-cqrs-protobuf-latest/blob/master/events/events.pb.go

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.28.0
// 	protoc        v3.19.4
// source: inputs/events.proto

package events

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
	reflect "reflect"
	sync "sync"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

type BookRoom struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	RoomId    string                 `protobuf:"bytes,1,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"`
	GuestName string                 `protobuf:"bytes,2,opt,name=guest_name,json=guestName,proto3" json:"guest_name,omitempty"`
	StartDate *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=start_date,json=startDate,proto3" json:"start_date,omitempty"`
	EndDate   *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=end_date,json=endDate,proto3" json:"end_date,omitempty"`
}

func (x *BookRoom) Reset() {
	*x = BookRoom{}
	if protoimpl.UnsafeEnabled {
		mi := &file_inputs_events_proto_msgTypes[0]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *BookRoom) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*BookRoom) ProtoMessage() {}

func (x *BookRoom) ProtoReflect() protoreflect.Message {
	mi := &file_inputs_events_proto_msgTypes[0]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use BookRoom.ProtoReflect.Descriptor instead.
func (*BookRoom) Descriptor() ([]byte, []int) {
	return file_inputs_events_proto_rawDescGZIP(), []int{0}
}

func (x *BookRoom) GetRoomId() string {
	if x != nil {
		return x.RoomId
	}
	return ""
}

func (x *BookRoom) GetGuestName() string {
	if x != nil {
		return x.GuestName
	}
	return ""
}

func (x *BookRoom) GetStartDate() *timestamppb.Timestamp {
	if x != nil {
		return x.StartDate
	}
	return nil
}

func (x *BookRoom) GetEndDate() *timestamppb.Timestamp {
	if x != nil {
		return x.EndDate
	}
	return nil
}

type RoomBooked struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	ReservationId string                 `protobuf:"bytes,1,opt,name=reservation_id,json=reservationId,proto3" json:"reservation_id,omitempty"`
	RoomId        string                 `protobuf:"bytes,2,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"`
	GuestName     string                 `protobuf:"bytes,3,opt,name=guest_name,json=guestName,proto3" json:"guest_name,omitempty"`
	Price         int64                  `protobuf:"varint,4,opt,name=price,proto3" json:"price,omitempty"`
	StartDate     *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=start_date,json=startDate,proto3" json:"start_date,omitempty"`
	EndDate       *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=end_date,json=endDate,proto3" json:"end_date,omitempty"`
}

func (x *RoomBooked) Reset() {
	*x = RoomBooked{}
	if protoimpl.UnsafeEnabled {
		mi := &file_inputs_events_proto_msgTypes[1]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *RoomBooked) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*RoomBooked) ProtoMessage() {}

func (x *RoomBooked) ProtoReflect() protoreflect.Message {
	mi := &file_inputs_events_proto_msgTypes[1]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use RoomBooked.ProtoReflect.Descriptor instead.
func (*RoomBooked) Descriptor() ([]byte, []int) {
	return file_inputs_events_proto_rawDescGZIP(), []int{1}
}

func (x *RoomBooked) GetReservationId() string {
	if x != nil {
		return x.ReservationId
	}
	return ""
}

func (x *RoomBooked) GetRoomId() string {
	if x != nil {
		return x.RoomId
	}
	return ""
}

func (x *RoomBooked) GetGuestName() string {
	if x != nil {
		return x.GuestName
	}
	return ""
}

func (x *RoomBooked) GetPrice() int64 {
	if x != nil {
		return x.Price
	}
	return 0
}

func (x *RoomBooked) GetStartDate() *timestamppb.Timestamp {
	if x != nil {
		return x.StartDate
	}
	return nil
}

func (x *RoomBooked) GetEndDate() *timestamppb.Timestamp {
	if x != nil {
		return x.EndDate
	}
	return nil
}

type OrderBeer struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	RoomId string `protobuf:"bytes,1,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"`
	Count  int64  `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"`
}

func (x *OrderBeer) Reset() {
	*x = OrderBeer{}
	if protoimpl.UnsafeEnabled {
		mi := &file_inputs_events_proto_msgTypes[2]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *OrderBeer) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*OrderBeer) ProtoMessage() {}

func (x *OrderBeer) ProtoReflect() protoreflect.Message {
	mi := &file_inputs_events_proto_msgTypes[2]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use OrderBeer.ProtoReflect.Descriptor instead.
func (*OrderBeer) Descriptor() ([]byte, []int) {
	return file_inputs_events_proto_rawDescGZIP(), []int{2}
}

func (x *OrderBeer) GetRoomId() string {
	if x != nil {
		return x.RoomId
	}
	return ""
}

func (x *OrderBeer) GetCount() int64 {
	if x != nil {
		return x.Count
	}
	return 0
}

type BeerOrdered struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	RoomId string `protobuf:"bytes,1,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"`
	Count  int64  `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"`
}

func (x *BeerOrdered) Reset() {
	*x = BeerOrdered{}
	if protoimpl.UnsafeEnabled {
		mi := &file_inputs_events_proto_msgTypes[3]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *BeerOrdered) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*BeerOrdered) ProtoMessage() {}

func (x *BeerOrdered) ProtoReflect() protoreflect.Message {
	mi := &file_inputs_events_proto_msgTypes[3]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use BeerOrdered.ProtoReflect.Descriptor instead.
func (*BeerOrdered) Descriptor() ([]byte, []int) {
	return file_inputs_events_proto_rawDescGZIP(), []int{3}
}

func (x *BeerOrdered) GetRoomId() string {
	if x != nil {
		return x.RoomId
	}
	return ""
}

func (x *BeerOrdered) GetCount() int64 {
	if x != nil {
		return x.Count
	}
	return 0
}

var File_inputs_events_proto protoreflect.FileDescriptor

var file_inputs_events_proto_rawDesc = []byte{
	0x0a, 0x13, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e,
	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x6d, 0x61, 0x69, 0x6e, 0x1a, 0x1f, 0x67, 0x6f, 0x6f,
	0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d,
	0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb4, 0x01, 0x0a,
	0x08, 0x42, 0x6f, 0x6f, 0x6b, 0x52, 0x6f, 0x6f, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6f,
	0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d,
	0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65,
	0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x75, 0x65, 0x73, 0x74, 0x4e, 0x61, 0x6d,
	0x65, 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18,
	0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
	0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
	0x70, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x44, 0x61, 0x74, 0x65, 0x12, 0x35, 0x0a, 0x08,
	0x65, 0x6e, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a,
	0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
	0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x44,
	0x61, 0x74, 0x65, 0x22, 0xf3, 0x01, 0x0a, 0x0a, 0x52, 0x6f, 0x6f, 0x6d, 0x42, 0x6f, 0x6f, 0x6b,
	0x65, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f,
	0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x65,
	0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6f,
	0x6d, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d,
	0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65,
	0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x75, 0x65, 0x73, 0x74, 0x4e, 0x61, 0x6d,
	0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03,
	0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74,
	0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f,
	0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69,
	0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x44, 0x61,
	0x74, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x06,
	0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
	0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
	0x52, 0x07, 0x65, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x65, 0x22, 0x3a, 0x0a, 0x09, 0x4f, 0x72, 0x64,
	0x65, 0x72, 0x42, 0x65, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6f, 0x6d, 0x5f, 0x69,
	0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12,
	0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05,
	0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x3c, 0x0a, 0x0b, 0x42, 0x65, 0x65, 0x72, 0x4f, 0x72, 0x64,
	0x65, 0x72, 0x65, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x18,
	0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x14, 0x0a,
	0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f,
	0x75, 0x6e, 0x74, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x62,
	0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}

var (
	file_inputs_events_proto_rawDescOnce sync.Once
	file_inputs_events_proto_rawDescData = file_inputs_events_proto_rawDesc
)

func file_inputs_events_proto_rawDescGZIP() []byte {
	file_inputs_events_proto_rawDescOnce.Do(func() {
		file_inputs_events_proto_rawDescData = protoimpl.X.CompressGZIP(file_inputs_events_proto_rawDescData)
	})
	return file_inputs_events_proto_rawDescData
}

var file_inputs_events_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_inputs_events_proto_goTypes = []interface{}{
	(*BookRoom)(nil),              // 0: main.BookRoom
	(*RoomBooked)(nil),            // 1: main.RoomBooked
	(*OrderBeer)(nil),             // 2: main.OrderBeer
	(*BeerOrdered)(nil),           // 3: main.BeerOrdered
	(*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp
}
var file_inputs_events_proto_depIdxs = []int32{
	4, // 0: main.BookRoom.start_date:type_name -> google.protobuf.Timestamp
	4, // 1: main.BookRoom.end_date:type_name -> google.protobuf.Timestamp
	4, // 2: main.RoomBooked.start_date:type_name -> google.protobuf.Timestamp
	4, // 3: main.RoomBooked.end_date:type_name -> google.protobuf.Timestamp
	4, // [4:4] is the sub-list for method output_type
	4, // [4:4] is the sub-list for method input_type
	4, // [4:4] is the sub-list for extension type_name
	4, // [4:4] is the sub-list for extension extendee
	0, // [0:4] is the sub-list for field type_name
}

func init() { file_inputs_events_proto_init() }
func file_inputs_events_proto_init() {
	if File_inputs_events_proto != nil {
		return
	}
	if !protoimpl.UnsafeEnabled {
		file_inputs_events_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*BookRoom); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
		file_inputs_events_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*RoomBooked); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
		file_inputs_events_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*OrderBeer); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
		file_inputs_events_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*BeerOrdered); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: file_inputs_events_proto_rawDesc,
			NumEnums:      0,
			NumMessages:   4,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_inputs_events_proto_goTypes,
		DependencyIndexes: file_inputs_events_proto_depIdxs,
		MessageInfos:      file_inputs_events_proto_msgTypes,
	}.Build()
	File_inputs_events_proto = out.File
	file_inputs_events_proto_rawDesc = nil
	file_inputs_events_proto_goTypes = nil
	file_inputs_events_proto_depIdxs = nil
}
@shi-rudo
Copy link
Author

after some research it seems to related to github.com/gogo/protobuf. a known issue in this library that isn't expected to be solved anytime soon.

It is advised to use another proto library such as google.golang.org/protobuf/proto instead. Any chances that watermill will adopt google.golang.org/protobuf/proto?

@shi-rudo shi-rudo changed the title CRQS-protobuf example (5-cqrs-protobuf) will break when using latest protoc-gen-go and protoc proto marshalling is failing with using latest protoc-gen-go and protoc Apr 22, 2022
@m110
Copy link
Member

m110 commented Apr 22, 2022

Hey. You can use your own CQRS marshaler if you implement the correct interface. You could just copy the one provided with Watermill and switch the library to golang/protobuf.

In the future, we want to address this in #281. :)

@roblaszczak
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants