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

Queue.Pull() and Transaction.Receive() do not return immediately when the queue is empty and the waitingSecond = 0 #8

Closed
francotiveron opened this issue Jan 3, 2022 · 4 comments

Comments

@francotiveron
Copy link

F# code excerpt

        let sw = Stopwatch()
        let q = Queue.Queue(queue, clientId, url, Log, WaitTimeSecondsQueueMessages = 0) 
        sw.Start()
        let pu = q.Pull(1, 0)
        sw.Stop()
        Log.d sw.ElapsedMilliseconds

The printout is always > 1000 when the queue is empty. I would expect to be 0 (edited)

@kubemq
Copy link
Contributor

kubemq commented Jan 3, 2022 via email

@francotiveron
Copy link
Author

francotiveron commented Jan 3, 2022

The Pull method has only 2 parameters

Pull(maxPullMessages: int, waitTimeoutSeconds: int)

What is Auto Ack? there is no mention in the .NET SDK

There is an entire namespace QueueStream in the SDK , but no documentation and not examples in the cookbook. Maybe you intent that one. Are there examples on how to use it outside of the cookbook repo?

@francotiveron
Copy link
Author

@kubemq I downloaded the repo and made some tests using the QueueStream API (see code below).

The result is the same, WaitTimeout 0 is not honoured, response never comes back quicker than 1s, regardless the value of AutoAck

let queue = "q-1"
let url = "localhost:50000"

let w = QueueStream(url, "writer")

let m1 = Message(
    Queue = queue
    , Body = Tools.Converter.ToByteArray "message-1"
    , Metadata = "meta-1"
) 

let sendRequest = SendRequest(ResizeArray([m1]))

let sendResponse = w.Send(sendRequest).Result

let r = QueueStream(url, "reader")

let pollRequest = PollRequest(Queue = queue, WaitTimeout = 0, MaxItems = 1, AutoAck = true)

let sw = Stopwatch()
sw.Start()
let pollResponse = r.Poll(pollRequest).Result
sw.Stop()

@kubemq
Copy link
Contributor

kubemq commented Dec 20, 2022

Please use the QueueStream implementation

@kubemq kubemq closed this as completed Dec 20, 2022
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

2 participants