Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 15 11:04

    megakid on master

    Ensure we dont make more connec… Merge pull request #18 from meg… (compare)

  • Sep 15 11:04
    megakid closed #18
  • Sep 15 11:03
    megakid opened #18
  • Jun 19 09:06
    christopherread commented #39
  • Jun 19 09:05
    christopherread commented #39
  • Jun 19 09:05
    christopherread commented #39
  • Jun 18 15:43
    julealgon commented #39
  • Jun 18 14:33
    christopherread labeled #39
  • Jun 18 14:27

    christopherread on master

    Update README.md Fixed ident o… (compare)

  • Jun 18 14:25
    christopherread commented #39
  • Jun 18 14:24
    christopherread commented #39
  • Jun 18 14:23
    christopherread commented #39
  • Jun 18 13:33
    julealgon opened #39
  • May 24 15:33
    christopherread closed #8
  • May 24 15:33
    christopherread commented #8
  • May 21 07:36
    christopherread commented #8
  • May 21 05:56
    ankorus commented #8
  • May 21 05:53
    ankorus commented #8
  • Apr 14 18:51

    megakid on v5.0.0

    (compare)

  • Apr 14 18:51

    megakid on master

    v5 prep net461 and Obvs 5.x No warn on 4.6.1 restore of AMQ… and 4 more (compare)

ankorus
@ankorus
It has something to do with protobuf. If un-comment .SerializedAsJson (and comment .SerializedAsProtoBuf) it works. SerializedAsProtoBuf works in .net core 2.1 'though.
Christopher Read
@christopherread
@ankorus that error is being thrown when it's trying to scan all assemblies in dir to find your message types, via reflection. As the error message suggests, there is a method to help, called .FilterMessageTypeAssemblies()
Christopher Read
@christopherread
Use that to only include your own assemblies, by passing in a lambda that checks assembly name, eg a => a.GetName().Name.StartsWith("MyProject")
I'm not sure which assembly is causing the error when you use protobuf, but hopefully the above should fix it
ankorus
@ankorus
Here is the list of assemblies filtered from framework: -mscorlib
ConsObvsApp
Obvs
-System.Reactive
Obvs.RabbitMQ
Obvs.Serialization.ProtoBuf
protobuf-net
-Anonymously Hosted DynamicMethods Assembly
RabbitMQ.Client
-System.Core
-System
Those marked with '-' are not getting listed when called from .net core. It looks like the problem is caused by Anonymously Hosted DynamicMethods Assembly. In another project I have seen Microsoft.GeneratedCode assembly. FilterMessageTypeAssemblies helps. Thx.
ankorus
@ankorus
Is there any way to influence queue name? It looks like obvs creates queue name using the following pattern: 'service name'.Requests-'hostname'-'user name'-'generated number'-1. Can this pattern be changed? Can at least the generated number be preset?
ankorus
@ankorus
Rx question:
response = serviceBusClient.GetResponses(request)
.SkipWhile(res => res.RequestId != request.RequestId)
.Take(1)
.Single()
Is there any way to add timeout here to wait for response with matching requestid only for certain time?
ankorus
@ankorus
Figured out my last rx question: Timeout after SkipWhile will do it.
Christopher Read
@christopherread
@ankorus some transport extensions may have implementations for queue/topic names
Christopher Read
@christopherread
but in general no, there is no configuration option for queue names - you can use MessageSource directly if you want, but then you lose a lot
there's no reason you cant connect to Obvs generated queues and messages from C++, provided you adhere to the conventions
ankorus
@ankorus
Thx, Chris. Could you, please, explain then the pattern: 'service name'.Requests-'hostname'-'user name'-'some number'-1. Is there a versioning on request/response contracts? What would happen if service/client refer to diff versions of contracts?
Christopher Read
@christopherread
Process process = Process.GetCurrentProcess();
string userName = identity;
string hostName = Dns.GetHostName();
return string.Format("{0}-{1}-{2}-{3}", process.ProcessName, hostName, userName, process.Id);
That code is in Obvs.Configuration.RequesterId
It uses process.Id to ensure responses are routed to correct process, although in sub/pub transports, the message would be received by all subscribers, just not surfaced from Obvs
ankorus
@ankorus
Thx, Chris. Process ID could be a stretch here as how would a remote raw non-obvs client know the process id? I am also getting "-1" at the end of the queue name. Where and why is this guy getting added?
Christopher Read
@christopherread
@ankorus the requesterId string is sent as a message property, to be used on the response, and vice versa
@ankorus it is being added to prevent your process from receiving responses for requests it didn't send, obviously ;)
all this is handled under the covers by Obvs, your scenario of trying to reverse engineer it in C++ process should work, but it is not designed for this, or supported
Christopher Read
@christopherread
but, perhaps if you're experiments are successful, you could port Obvs, Obvs.RabbitMQ, and Obvs.Serialization.Protobuf to C++ and put them on github
Andy Weston
@westonsoftware
Hi, I would like to send an ICommand that gets picked up by a single worker, can I use Obvs.NetMQ to do this? like UsingQueueFor<ICommand>() ?
ankorus
@ankorus
Next iteration of dll hell trying to use obvs client bus from .net fw 4.7.2. The app is referencing Sytem.Reactive, System.Reactive.Core and System.Reactive.Linq via nuget. All three of version 4.2.0 pre 560. System.Reactive is getting installed of requested v.4.2.0. However System.Reactive.Core and System.Reactive.Linq are getting installed of v.3.0.3. Creating service bus client the app is getting exception: Cannot load System.Reactive.Core v.3.0.1. ?! Anyone knows how to resolve this one?
Andy Weston
@westonsoftware
try adding System.Reactive.Compatibility ? I recently had to do something like this
@ankorus
ankorus
@ankorus
@westonsoftware Just tried System.Reactive.Compatibility which loaded 7 other dlls. Unfortunately it did not help. The exception is claiming that obvs.rabbitmq needs System.Reactive.Core 3.0.1. I have 3.0.3. It is interesting that my end-to-end fw unit tests run fine with the settings I have on the same server.
ankorus
@ankorus
@christopherread Could it be that obvs.rabbitmq was build somehow explicitly referencing system.reactive.core v.3.0.1 for framework? Otherwise I am wondering what else can require system.reactive.core v.3.0.1 if this version is not even in nuget.
ankorus
@ankorus
OK I found the issue. The output dll is getting generated with dll.config which has assembly binding section which includes system.reactive.core:
  <dependentAssembly>
    <assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" />
  </dependentAssembly>
For some reasons the calling exe is ignoring this dll.config. After copying assembly binding section into exe.config it started to work. I would appreciate an advise on how to avoid this section copy deploying dll.
ankorus
@ankorus
We have our dll which runs by exe not developed by us. When our dll is called it configures service bus, sends request and gets response. The code for configuration and getting responses is provided above.
If it is getting called too often it receives the following exception:
The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=405, text="RESOURCE_LOCKED - cannot obtain exclusive access to locked queue 'ABCServiceObvs.Responses-VM-SRV01-SYSTEM-4004-1' in vhost '/'. It could be originally declared on another connection or the exclusive property value does not match that of the or...", classId=50, methodId=10, cause=
Here is the call stack:
at RabbitMQ.Client.Impl.SimpleBlockingRpcContinuation.GetReply(TimeSpan timeout)
at RabbitMQ.Client.Impl.ModelBase.QueueDeclare(String queue, Boolean passive, Boolean durable, Boolean exclusive, Boolean autoDelete, IDictionary2 arguments) at RabbitMQ.Client.Impl.AutorecoveringModel.QueueDeclare(String queue, Boolean durable, Boolean exclusive, Boolean autoDelete, IDictionary2 arguments)
at Obvs.RabbitMQ.MessageSource1.<get_Messages>b__10_0(IObserver1 observer)
at System.Reactive.Linq.QueryLanguage.CreateWithDisposableObservable1.SubscribeCore(IObserver1 observer)
at System.Reactive.ObservableBase1.Subscribe(IObserver1 observer)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Reactive.ExceptionHelpers.ThrowIfNotNull(Exception exception)
at System.Reactive.Linq.QueryLanguage.LastOrDefaultInternalTSource
ankorus
@ankorus
What is the best solution or work around of the problem?
@christopherread Chris, can obvs rabbitmq queue be configured as non exclusive? Thx,
Christopher Read
@christopherread
@ankorus RabbitMQ uses exchanges and subscriber queues
the queues are unique to each subscription

@ankorus check out the MessageSource code here to better understand how Obvs subscriptions to RabbitMQ are implemented:

https://github.com/christopherread/Obvs.RabbitMQ/blob/master/Obvs.RabbitMQ/MessageSource.cs

Christopher Read
@christopherread

@westonsoftware Hi Andy, welcome!

In answer to your question, no that isn't possible. The reason being that Obvs.NetMQ doesn't implement this (I think I only implemented for Obvs.ActiveMQ).

Christopher Read
@christopherread

@westonsoftware the NetMQ transport does support queues it seems:
https://netmq.readthedocs.io/en/latest/queue/

So it would be a matter of porting + testing the code from Obvs.ActiveMQ to Obvs.NetMQ

ankorus
@ankorus
@christopherread How to resolve AMQP operation issue?
Christopher Read
@christopherread

@ankorus I suspect you have a concurrency issue: the caller of your DLL is making multiple calls to your DLL from within the same process that at times overlap

this causes more than one subscription on the RabbitMQ response subscription queue, thats only supposed to have one subscription, hence the error

the solution is to first ensure your code is only instantiating the Obvs ServiceBus so the response queue is only subscribed to once

Christopher Read
@christopherread
Obvs is designed to have a ServiceBus singleton that is instantiated once at start of process and disposes when process exits
ankorus
@ankorus
@christopherread This is regular single server - multiple clients case. We need multiple clients send requests of the same type and get responses of the same type. Server singleton is fine. Singleton for all clients is a stretch. If each client queue name will be different (there was my earlier question on this subject) would the issue be resolved? Or the issue is fundamental and all clients must seat on the same response queue by design?
ankorus
@ankorus
@christopherread I will convert client bus to singleton. Is there a way to find out that the bus it is closed or disposed and needs to recreated? IServiceBusClient does not expose methods for that. Another thought: after serviceBusClient.GetResponses is there a way to stop getting responses or each client will keep getting responses forever from the singleton bus?
Christopher Read
@christopherread
Singleton within a process
Multiple client processes is fine, one ServiceBus per process
ankorus
@ankorus
Even with one single DLL and service bus - singleton (meaning not re-creating) still getting AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=405, text="RESOURCE_LOCKED - cannot obtain exclusive access to locked queue.
Christopher Read
@christopherread
Check your RabbitMQ admin console to see if you can see the subscribers listed
ankorus
@ankorus
Using rabbitmq admin I can see exchange named like a bus, and 2 queues: for requests and commands. Don't see queue for responses. When I am invoking our functions using UI I can see the number of connections is constantly growing. We use blocking wait currently to get single reponse:
response = serviceBusClient.GetResponses(request)
.SkipWhile(res => res.RequestId != request.RequestId)
.Take(1)
.Single()