Git Product home page Git Product logo

nsqnet's People

Contributors

alexey-ernest avatar judwhite avatar uoiszero avatar wcharczuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nsqnet's Issues

NSQProtocol ReceiveMessage() not reading complete message

Hi,

I've noticed under high load RecieveMessage() does not always read the entire message from the network stream (probably in cases where the stream is not ready to be read)

You should be able to overcome this by changing

var size = BitConverter.ToInt32(sizebuffer, 0);

if (size != 0)
{
    byte[] buffer = new Byte[size];
    _networkStream.Read(buffer, 0, (int)size);

    return UnpackMessage(size, buffer);
}

to:

var size = BitConverter.ToInt32(sizebuffer, 0);

if (size != 0)
{
    byte[] buffer = new Byte[size];
    var read = 0;
    while (read < size) {
        var readCount = _networkStream.Read(buffer, read, (int)size-read);
        if (readCount < 0)
            continue;
         if (readCount == 0)
             break;
         read += readCount;
    }
    return UnpackMessage(size, buffer);
}

TLS/Deflate/Snappy; NSQnet compatibility guarantees

I'm working on some changes that I plan to submit a pull request for, which will add support for a number of new NSQ protocol options as well as negotiation for TLS/Deflate/Snappy support, and have a couple questions.

  1. Of these changes, the addition of Snappy may be most controversial, since it introduces dependencies on a native library & P/Invoke. I'm using https://www.nuget.org/packages/Snappy.NET/ which includes support for 32 & 64 bit environments. Any concerns/issues with adding this new reference (and the downstream dependency of https://www.nuget.org/packages/Crc32C.NET/)?
  2. Are there any strong versioning / compatibility guarantees for NSQClient? I'd like to introduce a NSQOptions class to house the more detailed configuration information, and am wondering how much I can/should clean up existing constructor overloads, or if I should preserve those (as well as passthrough getters/setters on the ShortIdentifier/LongIdentifier/HeartbeatMilliseconds properties, which would be duplicating the underlying options for the client). Given that NSQ has deprecated the ShortIdentifier & LongIdentifier names, a wholesale cleanup/update to match the current protocol state would be cleaner, but would be a breaking change. Does it make sense to roll a new major version for this, or would you prefer to have it implemented as a minor version with compatibility (marking the existing constructors/properties obsolete)? Taking advantage of the new options will require changes for anyone using NSQClient already, and the 'breaking changes' would be relatively minor...
  3. A potentially less problematic breaking change - any objection to marking the default NSQClient constructor as private instead of public (regardless of the major/minor versioning decisions)? As far as I can tell, that constructor is pointless, as there's no way to configure the nsqd hostname/port after construction (the NSQClient Hostname/Port properties are read-only) - which means the client should fail upon Initialize(). It seems making that constructor private would make usage more intuitive.

Thanks,
Levi

Add TLS?

I found in the NSQ client list that the client does not support the TLS protocol, which is very important in some environments at present. Can you extend the support?

Multiple Topics

Hi,

Is there a way to tell which topic a message came from when subscribing to multiple topics?

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.