Giter Site home page Giter Site logo

chinchilla's Introduction

chinchilla's People

Contributors

bitdeli-chef avatar cocowalla avatar jonnii avatar jonorossi avatar robertcoltheart 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chinchilla's Issues

Support for publish/subscribe interface implementations

I tried to test a publish/subscribe scenario with interface implementations and could not get it working.
I defined some message classes:

public interface IBaseMessage
{
    int MsgId { get; set; }
}
public class OtherMessage : IBaseMessage
{
    public int MsgId { get; set; }
    public int DataI { get; set; }
}
public class OtherMessage2: IBaseMessage
{
    public int MsgId { get; set; }
    public float DataF { get; set; }
}

and then published the message:

using (var bus = Depot.Connect("localhost"))
{
    while (running)
    {
        if (i % 2 == 0)
        {
            var pubMsg = new OtherMessage()
            {
                MsgId = i,
                DataI = i*2
            };
            bus.Publish<IBaseMessage>(pubMsg);
        }
        else if (i % 2 == 1)
        {
            var pubMsg = new OtherMessage2()
            {
                MsgId = i,
                DataF = i*3.0f
            };
            bus.Publish<IBaseMessage>(pubMsg);
        }
        i++;
        Thread.Sleep(1000);
    }
}

The subscriber looks like this, but no messages are received.

using (var bus = Depot.Connect("localhost"))
{
    bus.Subscribe<IBaseMessage>(SubscriberCallback);
 }
...
private static void SubscriberCallback3(IBaseMessage msg)
{
    string rcvMsg = String.Empty;
    if (msg is OtherMessage) {
        rcvMsg = String.Format("id {0}, dataI = {1}", msg.MsgId, (msg as OtherMessage).DataI);
    }
    else if (msg is OtherMessage2)
    {
        rcvMsg = String.Format("id {0}, dataF = {1}", msg.MsgId, (msg as OtherMessage2).DataF);
    }
    System.Console.WriteLine(rcvMsg);
}

If I explicitly publish/subscribe the derived classes instead of the interface, the messages are received correctly.
Is there any possiblity to use an interface or base abstract class for messages?

Connection

Hi Jonni,

Is there a way to check rabbitMQ connectivity. For example, if I create a IBus variable and successfully connect to RabbitMQ, few minutes later, the connectivity between client PC and RabbitMQ is disconnected, how I get knowledge that the connection has been disconnected?

Thank you,

Alan

RabbitMQ.Client new version (3.4.0)

The current Chinchilla nugget package contains the 3.1.x version of RabbitMQ.Client. There is a new version of RabbitMQ.Client (version 3.4). Is the current Chincilla support the new version of RabbitMQ.Client.

Prefetch count issue

ISubscriptionBuilder.WithPrefetchCount does not seem to have any effect.

For instance, after opening this subscription:

var subscription = _subscribingBus.Subscribe<RoutingKeyMessage<string>>(
                OnMsgReceive,
                b => b.WithPrefetchCount(1));

the queue still has the default prefetch count of 50.

I'll take a look and open a PR.

Topology Configurable Requester

The current requester does not expose the ability to configure its topologies

        public void Start()
        {
            subscription = bus.Subscribe<TResponse>(
                DispatchToRegisteredResponseHandler,
                    b => b.SetTopology<DefaultRequestTopologyBuilder>()
                          .DeliverUsing<TaskDeliveryStrategy>());

            var queue = subscription.Queues.First();
            publisher = bus.CreatePublisher<TRequest>(p => p.ReplyTo(queue.Name));
        }

@jonnii suggestions before I start hacking on this?

Connect to a cluster

Hello,

I saw a feature within Chinchilla where one can connect to a cluster by settings up the ConnectionStrings in the DepoSettings. However, ConnectionStrings property does not exist in DepoSettings class. How do I connect to a cluster, at least to two RabbitMQ hosts?

This is the cluster feature --> https://github.com/jonnii/chinchilla/pull/41/files

Thank you,

Alan

Configure Chinchilla to connect to RMQ Cluster

Hello,

I saw this post below concerning Chinchilla connecting to two Rabbit hosts in cluster environment. However, when I setup the DepotSettings, i do not see the property to 'ConnectionStrings' as shown in the post from below URL. How can I setup the DepotSettings to supply two RMQ hosts as described in below post? Your help is greatly appreciated.

#59

Frequent Invocation of CreatePublisher

Hello Jonathan,

I have an application where multiple users using. I have one exchange (topic) and one queue. Each consumer connects to that one exchange and queue with unique binding for each consumer. I have this application that is a publisher it publishes message to that one exchange and queue. This application establishes one single IBUS which establish one connection. Each message publish, the application invokes the 'CreatePublisher' (IPublisher) and then invokes the 'Publish' method. My question is, should I only invoke 'CreatePublisher' once, maintain that throughout the life of the application and simply invoke Publish method each time to publish a message?

I appreciate your feedback.

Thanks,

Alan

Send/Receive pattern

Hello,
Is it possible to implement the send/receive pattern with the available chinichilla bus interface ? We need this pattern for instance in a client/server scenario, where different clients send data to a well-known queue on a server application (several sender and one receiver).
Thanks in advance.

How to create topology using fanout

Sorry for me asking this but can you kindly provide example on how to create topology using fanout? The subscriber and consumer will use the fanout.

Thank you for your help.

Confirming Publisher Performance

If you're confirm a lot of messages there's room for improvement in the confirming publisher. Right now when ack/nacking multiple messages we iterate over all the keys of a concurrent dictionary, this is lazy and totally inappropriate. We should be using a min heap for this.

Custom publish fault strategies

I've given this a bit of thought, and I think what we should do is something like this:

bus.CreatePublisher<TMessage>(o => o.PublishFaultStrategy<TFaultStrategy>());

We'll add a new interface called IPublishFaultStrategy which will look something like this:

public interface IPublishFaultStrategy
{
    IPublishFailAction ProcessFailedPublish<TMessage>(TMessage message);
}

public interface IPublishFailAction<TMessage>
{
    void Process(IPublisher<TMessage> publisher, TMessage original);
}

What we might need to do is wrap a publishable message in a wrapper of some description, like I did with IDelivery so that we can tack on things like retry-count etc... but we can do that later.

For the default publisher setting this will do nothing, we should probably throw an exception if they try to do this because they might expect it to work, but it won't unless the publisher is transactional (which we don't yet support) or has confirms enabled. In fact, it might be better to make this is an overload of IPublisherBuilder.Confirm to make it less confusing.

For a confirming publisher there are a few weirdnesses. Firstly, when you get a nack it means that there was a message up to that message sequence number that failed, so it could be any of the receipts up to that number, which means we'll have to fail all of them. This could mean false positives? Users will have to ensure that all messages on the wire are idempotent.

Let me know what you think.

/cc @cocowalla

create custom headers when publish

How to send custom headers when I publish a message? I can read headers in the subscriber, but cannot find out how to publish custom headers.

Failure when subscriber throws exception

I have written a simple example with defect reproduction. Failure occurs when subscriber callback raises an exception. Eventually, Failed method of Chinchilla.Delivery in foreach class calls Accept method of Chinchilla.Delivery class, this call clears deliveryListeners collection. This causes "Collection was modified; enumeration operation may not execute" exception.

Duplicate receipt sequence numbers issued after bouncing the server

When the RabbitMQ server is restarted and the client reconnects, it restarts issuing receipts from sequence 1.

This results in DuplicatePublishReceiptException being thrown in Receipts<TMessage>.RegisterReceipt, as the ConcurrentDictionary will still contain unack'd receipts from the previous connection.

Acks/nacks are not sent when the broker restarts, so a simple solution is to clear out the receipts in the ConcurrentDictionary when reconnecting, though this will leave the client not knowing whether the messages were sent or not, and with no way to do anything about it.

Or maybe we can make use of the IPublisherFailureStrategy for this?

What do you think?

@jonnii

Fault strategies need to be rethought

The issue #31 raised a valid concern, which is that the delivery accept/reject stuff shouldn't be re-entrant, which it is because of the design of failures.

Failed messages shouldn't be responsible for clearing the delivery listeners on a delivery, that should happen on accept/reject.

Chincilla generating exception when using RabbitMQ client version 3.5

Hello,

When using current version of Chinchilla and update the RabbitMQ client to version 3.5, the following exception is generated when invoking Depo.Connect.

Could not load type 'RabbitMQ.Client.Events.ConnectionShutdownEventHandler' from assembly 'RabbitMQ.Client, Version=3.5.0.0, Culture=neutral, PublicKeyToken=89e7d7c5feba84ce'.

Thanks,

Alan

Logging doesn't allow for named loggers

AFAICS, the way that logging is currently implemented doesn't allow for creation of named loggers when using logging frameworks such as log4net or NLog.

Am I simply missing how this could be implemented with current ClassLoggersetup, or does the logging code need to be reworked?

Is there a way to determine if the connection is still opened

I would like to know if there is a way to check if the connection to RabbitMQ server is still connected. I know in ModelFactory there is IsOpen property. However, is not available in IBus interface. Is there a way to check IsOpen or similar to and verify the connectivity is still up?

Thanks,

Alan

Support .NET Standard

It would be nice to support .NET Standard as well as .NET Framework, so Chinchilla would run on .NET Core.

I've ran the Portability Advisor on the Chinchilla assembly, and the only issue was with DefaultMessageTypeFactory, which does some stuff with reflection and app domains that is no longer supported in .NET Standard.

I would do this, but I've been away from Chinchilla for quite a while, and am not very familiar with the code base any more. And looking at DefaultMessageTypeFactory it's rather difficult for me to decipher what it's doing :)

A custom requst/reply topology builder.

Hello. I need to use a custom request/reply topology builder. How can I inject this into the chinchilla bus instance? Or what do you think about approaches to implement this?

TaskDeliveryStrategy number of workers

Hi Jonathan,

If I don't supply NumWorkers property a value, what is the default number of workers to handle messages in TaskDeliveryStrategy? Should I set NumWorkers and what is the ideal number?

Thank you for your help.

Alan

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.