christopherread / obvs.netmq Goto Github PK
View Code? Open in Web Editor NEWNetMQ transport for Obvs
Home Page: http://christopherread.github.io/Obvs
License: MIT License
NetMQ transport for Obvs
Home Page: http://christopherread.github.io/Obvs
License: MIT License
When using the inproc://
protocol, it is not possible to e.g. Publish
when inside an observable context.
Setup
var serviceBus = ServiceBus
.Configure()
.WithNetMqEndpoints<IMyServiceMessage>()
.Named("MyService")
.BindToAddress("inproc://test")
.OnPort(default)
.SerializedAsNetJson()
.AsClientAndServer()
.UsingConsoleLogging()
.Create()
;
return serviceBus;
then
bus.Commands.Subscribe(
async (c) =>
{
Console.WriteLine("RECV(COMMAND): {0}", c.GetType().Name);
Console.WriteLine("sending event");
await bus.PublishAsync(new MyEvent($"OK: {c}")).GetAwaiter().GetResult();
}
);
also
bus.Events.Subscribe(
(e) =>
{
_logger.LogInformation("RECV(EVENT): {e}", e);
});
When sending a command, no event will be publised received.
RECV(COMMAND): MyCommand { Counter = 0 }
sending event
Sending command
sending event
RECV(COMMAND): MyCommand { Counter = 1 }
Probably because commands and events (and requests and responses) assumes they are on different ports, which they aren't in this scenario.
I guess this is a wontfix type issue, but it might be good to point out in the README, maybe.
Nevertheless, I'd like to thank you for a great library.
E.g. https://github.com/zeromq/netmq/blob/master/src/NetMQ.Tests/CurveTests.cs
Excerpt from test:
var serverPair = new NetMQCertificate();
using var server = new DealerSocket();
server.Options.CurveServer = true;
server.Options.CurveCertificate = serverPair;
server.Bind($"tcp://127.0.0.1:55367");
var clientPair = new NetMQCertificate();
using var client = new DealerSocket();
client.Options.CurveServerKey = serverPair.PublicKey;
client.Options.CurveCertificate = clientPair;
client.Connect("tcp://127.0.0.1:55367");
This is because MessageSources always use Connect and MessagePublishers always use Bind, whereas this should be specified based on whether it is a Client (use Connect) or Server endpoint (use Bind).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.