Code Monkey home page Code Monkey logo

nservicebus's People

Contributors

adamralph avatar andreasohlund avatar bording avatar chrisbednarski avatar danielmarbach avatar davidboike avatar dbelcham avatar dependabot-preview[bot] avatar dependabot[bot] avatar heskandari avatar indualagarsamy avatar janovesk avatar johannesg avatar johnsimons avatar lailabougria avatar mattburton avatar mauroservienti avatar mikeminutillo avatar mookid8000 avatar ramonsmits avatar remogloor avatar seanfeldman avatar shlomii avatar simoncropp avatar szymonpobiega avatar timbussmann avatar tmasternak avatar udidahan avatar williambza avatar yvesgoeleven 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  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  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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nservicebus's Issues

MessageMapper AddCustomAttributeToProperty ArgumentNullException

I found the bug in the MessageMapper implementation. Here is a detailed description of it:

http://www.filedropper.com/nservicebus-messagemapper-bug

In short:

We have a message with a supressionattribute. The suppressionattribute does not have a default constructor. When the default constructor is acquired in AddCustomAttributeToProperty the constructor info is null. the next line does not check for null and creates a CustomAttributeBuilder with null as input argument. This fails.

Could you fix that?

Daniel

Saga<T>.RequestTimeout does not respect DateTimeKind

When passing a DateTime of kind Utc, the subsctract of DateTime.Now can result in the wrong result.

    protected void RequestTimeout(DateTime at, object withState)
    {
        RequestTimeout(at - DateTime.Now, withState);
    }

Should be:

    protected void RequestTimeout(DateTime at, object withState)
    {
        RequestTimeout(at.ToLocalTime() - DateTime.Now, withState);
    }

Generic Host Requires Configuration File

in src\hosting\NServiceBus.Hosting.Windows\Program.cs, a check is done(line 38) for a config file and always throws an error. The expected result is to not throw the error, and informational message or warning could replace it.

Create queues at install time

When using the generic host, create the queues as a part of the install process (as it will most likely be running under the admin privileges needed).

Packit fails

I get the following error when running packit: (why am I getting promted for the OnlyUseLatestCLR)

PS C:\Users\andreas.ohlund\dev\NServiceBus\packages\nuget\PackagingUtils> .\packit.ps1
Value OnlyUseLatestCLR exists, overwrite(Yes/No)? Y
The operation completed successfully.
Value OnlyUseLatestCLR exists, overwrite(Yes/No)? Y
The operation completed successfully.
Rename-Item : Cannot create a file when that file already exists.
At C:\Users\andreas.ohlund\dev\NServiceBus\packages\nuget\PackagingUtils\RunOnce.ps1:4 char:12

  • Rename-Item <<<< ./RunOnce.ps1 NeverRunMeAgain.txt
    • CategoryInfo : WriteError: (C:\Users\andrea...ils\RunOnce.ps1:String) [Rename-Item], IOException
    • FullyQualifiedErrorId : RenameItemIOError,Microsoft.PowerShell.Commands.RenameItemCommand

Please restart and execute me a again
PS C:\Users\andreas.ohlund\dev\NServiceBus\packages\nuget\PackagingUtils> .\packit.ps1
Value OnlyUseLatestCLR exists, overwrite(Yes/No)? Y
The operation completed successfully.
Value OnlyUseLatestCLR exists, overwrite(Yes/No)? Y
The operation completed successfully.
Rename-Item : Cannot create a file when that file already exists.
At C:\Users\andreas.ohlund\dev\NServiceBus\packages\nuget\PackagingUtils\RunOnce.ps1:4 char:12

  • Rename-Item <<<< ./RunOnce.ps1 NeverRunMeAgain.txt
    • CategoryInfo : WriteError: (C:\Users\andrea...ils\RunOnce.ps1:String) [Rename-Item], IOException
    • FullyQualifiedErrorId : RenameItemIOError,Microsoft.PowerShell.Commands.RenameItemCommand

Please restart and execute me a again

NRE thrown when subscriber does not have MsmqTransportConfig defined

When a subscriber does not have the MsmqTransportConfig section defined in its app.config file, an exception is thrown during Bus.Start (UnicastBus.cs, line 716) when it attempts call transport.Address.ToLower(). It should throw a more helpful exception, stating that a subscriber must have MsmqTransportConfig defined.

The documentation on NServiceBus.com regarding pub/sub also does not mention that a subscriber must have both UnicastBusConfig and MsmqTransportConfig sections defined.

Remove build-net40.bat

Remove the build-net4.0.bat-> we already have a build.bat that builds for net4 so you can use that one instead.

I also suggest that you add a psake script in the root that does all the things you need (call nant for now) and then the copy and then packit.ps1

Manual creation of the 2.5 package

The current public package is a mess and needs to be cleaned up , we can do this manually for now:

  1. Download the official 2.5 edition from nservicebus.com
  2. Create a nservicebus package without any pdb files and with a log4net dep
  3. Create a nservicebus.host package without any pdb files and with a nservicebus dep
  4. Push to nuget

DBSubscriptionStorageConfig, NHibernateProperties not typed as NServiceBus.Config.NHibernatePropertyCollection

The property NHibernateProperties is typed as NServiceBus.Unicast.Subscriptions.NHibernate.Config.NHibernatePropertyCollection instead of
NServiceBus.Config.NHibernatePropertyCollection like how its defined in the NHibernateSagaPersisterConfig class.

There is no reason why these types should be different in both these classes.

This causes problems, when I try to add code to load both these configurations from the database assigning NHibernateProperties in code.

InMemorySagaPersister is not thread-safe

Running the InMemorySagaPersister under high load and with multiple worker threads causes "Collection has been modified" exceptions in the Get method. The Save methods potentially corrupt the dictionary.

Return to source queue is using the wrong source queue

Got the following from Thor Halvor Frivold:

When doing this i looked at the ReturnToSourceQueue in the git trunk:
var message = queue.ReceiveById(messageId, TimeoutDuration, MessageQueueTransactionType.Automatic);

            if (message == null)
                Console.WriteLine(NoMessageFoundErrorFormat, messageId);
            else
                using (var q = message.ResponseQueue)
                    q.Send(message, MessageQueueTransactionType.Automatic);

this is incorrect and will send the message back to original Sender (who does not have an endpoint for this endpoint and it is therefore lost) (and sometimes the responsequeue element is not even there)

The correct code is in the exe packed in the downloadable code. (code which gets the responsequeue from the element in the label)
string failedQueue = MsmqTransport.GetFailedQueue(m); m.Label = MsmqTransport.GetLabelWithoutFailedQueue(m); using (MessageQueue queue = new MessageQueue(failedQueue)) { Console.WriteLine("Returning message with id " + messageId + " to queue " + failedQueue); queue.Send(m, MessageQueueTransactionType.Automatic); }

NuGet Implementation

I have been using 2.5 through NuGet and it's been wonderful except for one thing. Every time I add a reference and all I want in just NServiceBus.dll and NServiceBus.Core.dll I get all of the other extraneous dlls for the various DI containers and such.

It would be great if NServiceBus was broken down more like Castle Windsor. Perhaps you could have a package that just had NServicesBus.dll and NServiceBus.Core.dll and call it something like NServiceBus Core and then one for Host that then referenced the core. You could even separate the DI containers as well.

Running powershell in net4.0 mode?

Are we 100% sure that we need to do this for nuget to work?

The reason I ask is that I have a hunch that it won't work on the buildservers since we can run as admin.

FileLoadException

A FileLoadException (Could not load file or assembly. Access is denied.) is being thrown by the HostServiceLocator on line 25 (NServiceBus v2.5) when starting many endpoints simultaneously (Easy to repro with 20+ endpoints). This doesn't seem to be a problem with windows file system permissions or background indexers/virus scanners deadlocking the files.

Magnum.StateMachine.StateMachineException was unhandled
Message=Exception occurred in
Topshelf.Internal.ServiceController`1[[NServiceBus.Host.Internal.GenericHost,
NServiceBus.Host, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=9fc386479f8a226c]] during state Initial while handling OnStart
Source=NServiceBus.Host
StackTrace:
Server stack trace:
at Magnum.StateMachine.ExceptionActionDictionary`1.HandleException(T
stateMachine, Event event, Object parameter, Exception exception)
at Magnum.StateMachine.EventActionList`1.Execute(T stateMachine, Event
event, Object parameter)
at Magnum.StateMachine.State`1.RaiseEvent(T instance, BasicEvent`1
eevent, Object value)
at Magnum.StateMachine.StateMachine`1.RaiseEvent(Event raised)
at
System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr
md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext,
Object[]& outArgs)
at
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage
msg, Int32 methodPtr, Boolean fExecuteInContext)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type)
at Topshelf.Internal.ServiceControllerProxy.Start()
at Topshelf.Internal.ServiceCoordinator.Start()
at Topshelf.Internal.Hosts.ConsoleHost.Run()
at NServiceBus.Host.Program.Main(String[] args)
InnerException:
Message=Exception when starting endpoint, error has been logged. Reason:
Could not load file or assembly 'file:///MyEndpoint.dll' or one of its dependencies.
Access is denied.
Source=NServiceBus.Host
StackTrace:
at NServiceBus.Host.Internal.GenericHost.Start()
at Magnum.StateMachine.EventActionList`1.Execute(T stateMachine,
Event event, Object parameter)
InnerException:

Add a dependency lifecycle enum

deprecating the associated interface on the Configurer stuff which accepts ComponentCallEnum and then exposing a newer interface that works with a new DependencyLifecycle enum. Under the hood the containers and builder stuff would work with DependencyLifecycle.

The names currently are:

“None” means “the default for the container”, it’s not used anywhere.

“Singleton” means the container will only construct one instance and all calls will return the same reference.

“Singlecall” means that the container will build a new one each time “Build” is called.

In discussion with Andreas we determined that some different names might better to avoid confusion between the meaning of “Singlecall” and “Singleton”. The names are:

SingleInstance, formally Singleton

InstancePerUnitOfWork

InstancePerCall

Publish<TMessage> without Action does not publish

Just spent several hours overlooking my nservicebus configurations till I found out that the following code is syntactically correct but does not publish the message:

this.Bus.Publish();

when I use this.Bus.Publish(m => { });

v2.5

it works!

Specifying a DistributorControlAddress results in an exception

Branch: master

Repro:

Specify a DistributorControlAddress and a DistributorDataAddress in the App.config of MyServer in the RequestResponce sample and launch the debugger.

(This also happens in my test project using different object builders)

Result:

NServiceBus.Grid.MessageHandlers.ReadyManager.SendReadyMessage() (ReadyManager.cs line 41) is invoked before the Bus is initialised/started. This results in Transport.NumberOfWorkerThreads returning zero and Bus.Send(DistributorControlAddress, messages) (ReadyManager.cs line 70) being invoked with an empty set of messages. Even if messages where being sent the Bus would still exception as it is not yet started.

This means that buses cannot be configured to use Distributor.

It looks like SendReadyMessage() on the Grid.ReadyManager is being invoked too early during spin up.

Sorry I haven’t submitted an automated test

Cannot use IP address in place of queue name

NServiceBus.Utils.GetFullPath() states it will allow either an IP address or a machine name after the @ in a queue specifier. However when I try to use the IP address in the input queue name (so that replies are routed by IP address when the remote server can't resolve the name), NServiceBus.Unicast.Transport.Msmq.MsmqTransport.CheckConfiguration() throws and exception because it only accepts the machine name.

Create a nsb25 sp1 from the latest build from Teamcity

  • Get the latest 2.5 builds from teamcity.codebetter.com
  • Create both a standard and community version of the .zip file (both 3.5 and 4.0, take a look at the download from nsb.com for reference)
  • Report when done so that we can upload both zip's to the website
  • Update our 2.5 nuget package with the latest community edition (including the processes)
  • Push to nuget (don't delete the old one from nuget!)

Test: Single_call_components_in_the_parent_container_should_be_singletons_in_the_child_container wrong?

[Test]
public void Single_call_components_in_the_parent_container_should_be_singletons_in_the_child_container()
{
VerifyForAllBuilders(builder =>
{
builder.Configure(typeof(InstancePerUoWComponent), DependencyLifecycle.InstancePerUnitOfWork);

            var nestedContainer = builder.BuildChildContainer();

            Assert.AreEqual(nestedContainer.Build(typeof(InstancePerUoWComponent)), nestedContainer.Build(typeof(InstancePerUoWComponent)));
        },
         typeof(SpringObjectBuilder),
        typeof(UnityObjectBuilder),
        typeof(NinjectObjectBuilder));

should that be:

The description of the test does not match with the implemented specification. Is this copy paste to blame?

    }

Remove the extra dll's folder and pdb:s from the nservicebus package

The following files are installed when I install the 3.0.0.0 package

Directory: C:\Users\andreas.ohlund\nsbnuget\NServiceBus.3.0.0.0\lib\net35

Mode LastWriteTime Length Name


d---- 2011-06-08 21:20 containers
d---- 2011-06-08 21:20 x64
-a--- 2011-06-08 21:20 270336 log4net.dll
-a--- 2011-06-08 21:20 3760128 NServiceBus.Core.dll
-a--- 2011-06-08 21:20 8168960 NServiceBus.Core.pdb
-a--- 2011-06-08 21:20 3014021 NServiceBus.Core.xml
-a--- 2011-06-08 21:20 22016 NServiceBus.dll
-a--- 2011-06-08 21:20 669184 NServiceBus.Host.exe
-a--- 2011-06-08 21:20 1504768 NServiceBus.Host.pdb
-a--- 2011-06-08 21:20 36272 NServiceBus.Host.xml
-a--- 2011-06-08 21:20 669184 NServiceBus.Host32.exe
-a--- 2011-06-08 21:20 1504768 NServiceBus.Host32.pdb
-a--- 2011-06-08 21:20 36274 NServiceBus.Host32.xml
-a--- 2011-06-08 21:20 48640 NServiceBus.pdb
-a--- 2011-06-08 21:20 338944 NServiceBus.Testing.dll
-a--- 2011-06-08 21:20 794112 NServiceBus.Testing.pdb
-a--- 2011-06-08 21:20 273965 NServiceBus.Testing.xml
-a--- 2011-06-08 21:20 53011 NServiceBus.xml
-a--- 2011-06-08 21:20 135168 nunit.framework.dll
-a--- 2011-06-08 21:20 886272 System.Data.SQLite.DLL

Dictionary<string,object> deserialization problem

Hi,
I'm sending message that contains Dictionary<string, object> property. Serialization works fine, but dictionary values disappear during deserialization. Dictionary contains pairs like <string, int>, <string, decimal>, <string, string> etc.
After spending some times debugging I found out that problem is related with this part of code:

public class MessageSerializer
    private object GetPropertyValue(Type type, XmlNode n) {
        foreach (XmlNode xn in n.ChildNodes) // go over KeyValuePairs
        {
            object key = null;
            object value = null;

            foreach (XmlNode node in xn.ChildNodes)
            {
                if (node.Name == "Key")
                    key = GetObjectOfTypeFromNode(keyType, node);
                    // node.Name for pairs in my dictionary are string:Value, decimal:Value, int32:Value, so none of these values are deserialized
                    if (node.Name == "Value")
                        value = GetObjectOfTypeFromNode(valueType, node);
            }

            if (result != null && key != null) result[key] = value;
        }

Adding "else if" block fixed this:

if (node.Name == "Value") {
    value = GetObjectOfTypeFromNode(valueType, node);
} 
if (node.Name == "Value") {
    value = GetObjectOfTypeFromNode(valueType, node);
}
else if (node.Name.Contains(":")) // should I use .EndsWith(":Value") instead?
{
    Type dictValueType = Type.GetType("System." + node.Name.Substring(0, node.Name.IndexOf(":")), false, true);                         
    value = GetObjectOfTypeFromNode(dictValueType, node);
}

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.