GitHub user amareshmad edited a discussion: Dot Pulsar consumer Issue :DotPulsar.Exceptions.ChannelNotReadyException: The channnel is not ready yet
**When I create .NET framework/.net core console app, I could be able to create a client and able to create consumer and receiving the messages as well but when I integrate it into my actual project it is not building the consumer ** For the first time from console got the issue DotPulsar.Exceptions.ChannelNotReadyException: The channnel is not ready yet later it is not generated, created the consumer and able consume messages when I integrated same code with my actual project which supposed to create consumer, it is not creating the client consumer. I always getting the exceptin DotPulsar.Exceptions.ChannelNotReadyException: The channnel is not ready yet DotPulsar.Exceptions.ChannelNotReadyException: The channnel is not ready yet at DotPulsar.Internal.NotReadyChannel`1.Receive(CancellationToken cancellationToken) at DotPulsar.Internal.Consumer`1.<ReceiveMessage>d__24.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Threading.Tasks.ValueTask`1.get_Result() at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1.ConfiguredValueTaskAwaiter.GetResult() at DotPulsar.Internal.Executor.<Execute>d__9`1.MoveNext() More info both test app & actual product code are running in same machine. .Net framework :4.8 Installed .net core sdk 6.0 async Task TestConsumer(){ const string myTopic = "global.qa.xxxxRequestV1.Queue"; string SERVICE_URL = "pulsar+ssl://xxxxx.xxxx.com:6651"; string username = "xxxxxxx"; string password = "xxxxxxxx"; Uri sURl = new(SERVICE_URL); Console.WriteLine($"Build consumer client....."); ExceptionHandler pException = new ExceptionHandler(); await using var client = PulsarClient.Builder() .Authentication(new AuthenticationBasic(username, password)) .ServiceUrl(sURl) .VerifyCertificateName(false) .VerifyCertificateAuthority(false) .ExceptionHandler(pException.OnException) .Build(); Console.WriteLine($"creating Consumer......."); await using var consumer = client.NewConsumer() .Topic(myTopic) .SubscriptionType(SubscriptionType.Shared) .SubscriptionName("xxxxxxxxxxxxxxxx) .Create(); Console.WriteLine($"Waiting for consumer message......."); await foreach (var message in consumer.Messages()) { Console.WriteLine($"Received consumer: {Encoding.UTF8.GetString(message.Data.ToArray())}"); await consumer.Acknowledge(message); } } public class AuthenticationBasic : IAuthentication { private string username; private string password; public AuthenticationBasic(string uname, string passwd) { username = uname; password = passwd; } public string AuthenticationMethodName { get { return "oms3.0"; } } public ValueTask<byte[]> GetAuthenticationData(CancellationToken cancellationToken) { return new ValueTask<byte[]>(Encoding.UTF8.GetBytes(username + ":" + password)); } } public interface IHandleException { /// <summary> /// Called after an action has thrown an Exception. /// </summary> ValueTask OnException(ExceptionContext exceptionContext); } public class ExceptionHandler : IHandleException { //static private readonly ILog log = LogManager.GetLogger(typeof(DESPulsarQueue)); public ValueTask OnException(ExceptionContext exceptionContext) { Console.WriteLine("An error occured while creating pulsar client:{0}", exceptionContext.Exception.StackTrace.ToString()); return new ValueTask(); } } @JasperFx / wolverine @CHIRAGGANDHI @JasperFx GitHub link: https://github.com/apache/pulsar/discussions/18001 ---- This is an automatically sent email for dev@pulsar.apache.org. To unsubscribe, please send an email to: dev-unsubscr...@pulsar.apache.org