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

Implement a durable consumer #28

Closed
mango-habanero opened this issue Apr 27, 2023 · 2 comments
Closed

Implement a durable consumer #28

mango-habanero opened this issue Apr 27, 2023 · 2 comments
Assignees
Labels
WIP On-going work

Comments

@mango-habanero
Copy link
Contributor

Refactor the ephemeral subscription pattern used in the nats plugin and add a durable consumer that implements push subscriptions.

@mango-habanero mango-habanero added the WIP On-going work label Apr 27, 2023
@mango-habanero mango-habanero self-assigned this Apr 27, 2023
mango-habanero pushed a commit that referenced this issue Apr 30, 2023
- separate transaction handling for "GraphTransaction" and
"CustodialTransferEvents": N/B this will be consolidated later.

Closes #28
mango-habanero pushed a commit that referenced this issue Apr 30, 2023
- Removed the setTimeout line that was causing a fixed delay of 5 seconds.
- Ensured consistent error handling by adding message.ack() in the try block after processing a message and moving it up from the processMessage function.
- Introduced a processing variable to control the message processing loop. When the server shuts down, the processing variable is set to false, causing the loop to exit.
- Updated the onClose hook to properly terminate the done function by setting processing to false, draining the subscription, and unsubscribing from the subscription.
- Remove unnecessary console log.
- Move handlers into dictionary.

Closes #28
mango-habanero pushed a commit that referenced this issue Apr 30, 2023
- Removes unused counterParty function argument.
- Removes unnecessary type casting.

Closes #28
@mango-habanero mango-habanero reopened this May 2, 2023
@mango-habanero
Copy link
Contributor Author

Nats consumer blocks abruptly and unblocks on restart

@mango-habanero
Copy link
Contributor Author

Switched to a callback pattern for message processing, and also discovered that the handling of Postgres connections was the cause of the blocking in the server.

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

No branches or pull requests

1 participant