Postgres subscriptions (working stub example) #6404
Replies: 3 comments 5 replies
-
More than one year later, I have the same question/problem. The documentation is extremely lacking. Please provide some kind of working example, instead of having to read through the code to know how to use a theoretically supported feature. |
Beta Was this translation helpful? Give feedback.
-
Hi @Alorien1984 The Postgres integration for subscription should be used together with ITopicEventSender (and ITopicEventReceiver). To Send subscriptions you can use the SendAsync method, to listen to subscription events, you should use the ITopicEventReceiver and subscribe to the same topic that you push messages to. In the documentation you find this here: You cannot directly notify the topic in postgres, as the structure of the encoded message might change. |
Beta Was this translation helpful? Give feedback.
-
@Alorien1984 I am unsure what the
|
Beta Was this translation helpful? Give feedback.
-
Product
Hot Chocolate
A warm welcome to the esteemed developers and members of the HotChocolate community!
I'm trying to figure out the relationship between HotCgocolate subscriptions and the PostgresQL notification mechanism.
I have notifications being created in PostgresQL under the channel name 'hotchocolate_subscriptions'.
Example:
NOTIFY "hotchocolate_subscriptions", 'This is payload!'
I have connected AddPostgresSubscriptions in this way:
I defined a subscription in the Subscription class this way:
The project starts correctly, but I don't see any messages by the name of this channel in HotChocolate GraphQL UI.
Can I find a correct example somewhere? The documentation didn't give any answers.
Would you please be so kind as to you tell me what I am doing wrong?
Regards.
Beta Was this translation helpful? Give feedback.
All reactions