Hi Adriana,

It seems like a bug with synchronization context and lack of proper
handling of ConfigureAwait by the lib. We faced something similar with
ArtemisNetClient and an old WCF application[1].

It works fine in the console app, because it doesn't have the
synchronization context. Desktop applications using technologies like
WinForms or WPF rely heavily on synchronization context to dispatch ui
updates on the proper ui-rendering thread which may lead to this kind of
dead-locks.

To confirm this you could try to wrap your code inside of Task.Run(() =>
{}) block. It should work fine that way but it's hardly a feasible
workaround.

[1]
https://github.com/Havret/dotnet-activemq-artemis-client/issues/381#issuecomment-1279776799

Thanks,
Chris

On Mon, Dec 12, 2022 at 10:30 AM Adriana Cass <adriana.c...@visma.com>
wrote:

> Hi, I have updated my .net c#project to use 2.0.0 version of
> Apache.NMS.ActiveMQ and i noticed that when i'm starting the connection
> just hangs when i use the code in a .net c# windows form application, but
> it works just fine from a.net c# console application. var connString =
> $"tcp://HostName:61616"; IConnectionFactory factory = new
> NMSConnectionFactory(connString); using (IConnection connection =
> factory.CreateConnection()) { connection.Start(); //here it just hangs from
> a .net c# win forms app } This code works ok with 1.8.0 version of
> Apache.NMS.ActiveMQ no matter if is a .net c# win form app or a .net c#
> console app Other people are also having the same problem. Please see
>
> https://stackoverflow.com/questions/74692814/producer-messages-using-apache-nms-console-app-and-windows-forms
>   Do you have any inputs on this? Was 2.0.0 .net c# Apache.NMS.ActiveMQ lib
> tested from a .net win for application? Thank you, Adriana
>

Reply via email to