I did a quick search on the web and I found this [1]. It looks like the error you're getting is just some generic problem. Is there any logging from you application which indicates the problem is with the NMS code?
Justin [1] https://learn.microsoft.com/en-us/windows/win32/seccrypto/common-hresult-values On Sat, Sep 16, 2023 at 10:29 AM Torgeir Lund < torgeir.l...@vitecsoftware.com> wrote: > Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL) > > We have createt a C# Dll using ActiveMq.NMS > > We create a connection > > public void Init(string amqUrl) > { > try > { > ConnectionFactory connectionFactory = new > ConnectionFactory(amqUrl); > _connection = connectionFactory.CreateConnection(); > _session = > _connection.CreateSession(AcknowledgementMode.ClientAcknowledge); > _connection.Start(); > } > catch (NMSException e) > { > Console.WriteLine(e); > throw; > } > catch (Exception e) > { > Console.WriteLine(e); > throw; > } > } > > > We then create a consumer > public void CreateConsumer(string queueName) > { > if (!consumerDictionary.ContainsKey(queueName)) > { > try > { > IDestination destination = _session.GetQueue(queueName); > IMessageConsumer consumer = > _session.CreateConsumer(destination); > consumerDictionary.Add(queueName, consumer); > } > catch (NMSException e) > { > Console.WriteLine(e); > throw; > } > catch (Exception e) > { > Console.WriteLine(e); > throw; > } > } > > } > Then we calle receivestring and wait for a message > public string ReceiveString(string consumerName) > { > if (consumerDictionary.ContainsKey(consumerName)) > { > try > { > IMessageConsumer consumer = > (MessageConsumer)consumerDictionary[consumerName]; > _message = consumer.Receive(); > if (_message is Message) > { > ITextMessage msg = (ITextMessage)_message; > return msg.Text; > } > > return null; > > } > catch (NMSException e) > { > Console.WriteLine(e); > throw; > } > catch (Exception e) > { > Console.WriteLine(e); > throw; > } > > } > > return null; > } > After an our an exception occurs as follows > > Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL) > > Have anybody experienced similar problem? > > > Torgeir Sjur Lund, System Developer > Vitec Aloc > Telefon +45 2999 7122 > > Sendt fra min mobiltelefon >