You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Pulsar consumer builder is generic over DeserializeMessage but the async Pulsar client building seems to require concrete types.
let client = pulsar::Pulsar::builder("pulsar://localhost:6650",TokioExecutor).build().await.expect("Failed to create Pulsar client");
# typeTestData = String;letmut consumer:Consumer<TestData,_> = client
.consumer().with_topic("non-persistent://public/default/test").with_consumer_name("test_consumer").with_subscription("test_subscription").build()// works with string type.await?;
# typeTestData = unknown;// toy generic exampleletmut consumer:Consumer<{unknown},_> = client
.consumer().with_topic("non-persistent://public/default/test").with_consumer_name("test_consumer").with_subscription("test_subscription").build()// type inside `async` block must be known in this context// cannot infer type for type parameter `T` declared on the method `build`.await?;
Should the client builder build() accept trait objects?
The text was updated successfully, but these errors were encountered:
The Pulsar consumer builder is generic over DeserializeMessage but the async Pulsar client building seems to require concrete types.
Should the client builder build() accept trait objects?
The text was updated successfully, but these errors were encountered: