-
Notifications
You must be signed in to change notification settings - Fork 173
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
Does Nats jetstream support websocket as server address url? #1360
Comments
JetStream should work just fine. Providing a scheme with This test run just fine: #[tokio::test]
async fn jetstream() {
let _server = nats_server::run_server("tests/configs/ws.conf");
let client = async_nats::ConnectOptions::new()
.retry_on_initial_connect()
.connect("ws://localhost:8444")
.await
.unwrap();
let jetstream = jetstream::new(client);
jetstream
.create_stream(jetstream::stream::Config {
name: "foo".into(),
subjects: vec!["foo.*".into()],
storage: jetstream::stream::StorageType::File,
..Default::default()
})
.await
.unwrap();
let ack = jetstream
.publish("foo.bar", "hello".into())
.await
.unwrap()
.await
.unwrap();
println!("{:?}", ack);
} |
If I use nats:// it works but with ws:// it fails. For ws:// I had to add
It works fine with Could that be that it doesn't support credentials file ? Here is the complete code:
|
What is your server config? |
Proposed change
Support websocket in nats jetstream rust package.
Use case
In offical documentation, I find the native nats support the websocket as url here. But does the jetstream support it?
I wasnt able to make jetstream consumer lib to work with rust library.
I check the rust lib doc. Only find this and the corresponding code here. In there lib code, I didn't find other extra requirement for setting websocket. No extra function to set websocket, and seems their source code can directly get ws keywords in server address. But as we discussed before, maybe design for native nats rather than jetstream.
Contribution
No response
The text was updated successfully, but these errors were encountered: