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

ordered pull consumer is not working #1145

Closed
asnimansari opened this issue Oct 30, 2023 · 6 comments
Closed

ordered pull consumer is not working #1145

asnimansari opened this issue Oct 30, 2023 · 6 comments
Labels
defect Suspected defect such as a bug or regression

Comments

@asnimansari
Copy link

asnimansari commented Oct 30, 2023

Observed behaviour

When I try to create an ordered pull consumer as per the documentation https://docs.rs/async-nats/latest/async_nats/jetstream/consumer/type.OrderedPullConsumer.html

Code I used

         .create_consumer(
                
                jetstream::consumer::pull::OrderedConfig {
                    name: Some("consumer".to_string()),
                    ..Default::default()
                },
            )

I received the following error

Failed to create consumer: Error { kind: JetStream(Error { code: 400, err_code: ErrorCode(10084), description: Some("consumer in pull mode requires ack policy") }), source: None }

Expected behavior

Should build and work

Server and client version

Nats server 2.10.3

Host environment

No response

Steps to reproduce

No response

@asnimansari asnimansari added the defect Suspected defect such as a bug or regression label Oct 30, 2023
@Jarema
Copy link
Member

Jarema commented Oct 30, 2023

Thanks for filling the issue!

This is a server error reported on older version (If I recall correctlu <2.9).

I see you reported using nats server 2.10.3, but it seems that the server that is meta group leader is not that version.

Can you elaborate a little on your topology?
(basic cluster info, leaf nodes, etc)

@asnimansari
Copy link
Author

It is a basic 3 node cluster.

@Jarema
Copy link
Member

Jarema commented Oct 31, 2023

EDIT: Realized there is one path when its possible:

Are you trying to run it againt workqueue stream?

@asnimansari
Copy link
Author

Yes, the retention policy is WorkQueuePolicy

@Jarema
Copy link
Member

Jarema commented Oct 31, 2023

You can't use ordered pull consumer with work queue stream, as it uses AckNone.

@Jarema
Copy link
Member

Jarema commented Nov 2, 2023

I'm closing this issue, as this is not a bug.
I also issued a PR against the server to improve the error message.

@Jarema Jarema closed this as completed Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Suspected defect such as a bug or regression
Projects
None yet
Development

No branches or pull requests

2 participants