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

Bug: PubSub subscription declared in service subpackage doesn't fire handler #500

Open
pksieminski opened this issue Nov 1, 2022 · 0 comments

Comments

@pksieminski
Copy link

pksieminski commented Nov 1, 2022

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.

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

1 participant