Bug: PubSub subscription declared in service subpackage doesn't fire handler
pksieminski opened this issue · comments
Patryk Siemiński commented
Moving PubSub subscription declaration to service subpackage results in handler not being fired when new messages are published to the topic.
Considering the following payment
service structure:
payment
├── event
│ └── event.go
└── pubsub.go
With event.go
in event
subpackage, declaring the subscription:
var _ = pubsub.NewSubscription(
event.Orders, "payment-orders-sub",
pubsub.SubscriptionConfig[*event.OrderEvent]{
Handler: payment.OrderEventHandler,
},
)
The payment.OrderEventHandler
is not fired, but if subscription is moved back to pubsub.go
in payment
package, it works properly.