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

Feature/queue browser remove message #47

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

spencerhank
Copy link

No description provided.

browser.log('Received message: ' + message.getGuaranteedMessageId());
browser.messages[message.getGuaranteedMessageId()] = message;
// Need to explicitly ack otherwise it will not be deleted from the message router
// message.acknowledge();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this work? can the browser actually acknowledge and remove a message?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lot of left over comments and code from the file I originally copied. I actually intended to make this PR to my forked repository, but here we are :). I'll try to clean it up.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm glad you made the PR as a contribution to the main repo! I'm reviewing

browser.messageBrowser.on(solace.QueueBrowserEventName.MESSAGE, function (message) {
browser.log('Received message: ' + message.getGuaranteedMessageId());
browser.messages[message.getGuaranteedMessageId()] = message;
// Need to explicitly ack otherwise it will not be deleted from the message router
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "Need" is the wrong word here. If you're "browsing" messages you usually leave them on the queue for the "real" consumers to process. I think we should provdie a comment with a bit more guidance

/**
* Solace Systems Node.js API
* Persistence with Queues tutorial - Queue browser
* Demonstrates receiving persistent messages from a queue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

improve notes to say we are browsing messages and why you'd want to do that vs. receive them.
Also what are the expectations here? does it browse one message in the queue? or many?

@Mrc0113
Copy link
Member

Mrc0113 commented Jul 12, 2024

Thank you @spencerhank for contributing this! I made a few comments above.
Also tagging in @TamimiGitHub to review further as someone who actually knows JavaScript

});
// Define message received event listener
browser.messageBrowser.on(solace.QueueBrowserEventName.MESSAGE, function (message) {
browser.log('Received message: ' + message.getGuaranteedMessageId());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this actually receive message? It's not really receiving a message as much as its browsing the message, the message is not removed from the queue. Also we can add more information on the browsed message apart from just getGuaranteedMessageId()

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

Successfully merging this pull request may close these issues.

3 participants