I am wishing someone here will have the ability to aid me with my struggles with integration with ActiveMQ from C#. This is what Used to do to date:

using Apache.NMS;
using Apache.NMS.ActiveMQ;
namespace JMSTest {
  class Program {
    static void Main(string[] args) {
      IConnectionFactory factory = new ConnectionFactory("tcp://localhost:61616/");
      IConnection connection = factory.CreateConnection();
      ISession session = connection.CreateSession();

Pretty fundamental stuff: just produce a connection factory, then utilize it to produce the bond and also at the finish produce a session. Now after i execute this code this is actually the exception that's being tossed:

System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
   at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
   at System.String.Substring(Int32 startIndex, Int32 length)
   at Apache.NMS.ActiveMQ.OpenWire.StringPackageSplitter.StringPackageSplitterEnumerator.System.Collections.IEnumerator.get_Current()
   at Apache.NMS.ActiveMQ.OpenWire.OpenWireBinaryWriter.Write(String text)
   at Apache.NMS.ActiveMQ.OpenWire.BaseDataStreamMarshaller.LooseMarshalString(String value, BinaryWriter dataOut)
   at Apache.NMS.ActiveMQ.OpenWire.V2.ConnectionIdMarshaller.LooseMarshal(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut)
   at Apache.NMS.ActiveMQ.OpenWire.OpenWireFormat.LooseMarshalNestedObject(DataStructure o, BinaryWriter dataOut)
   at Apache.NMS.ActiveMQ.OpenWire.BaseDataStreamMarshaller.LooseMarshalCachedObject(OpenWireFormat wireFormat, DataStructure o, BinaryWriter dataOut)
   at Apache.NMS.ActiveMQ.OpenWire.V2.ConnectionInfoMarshaller.LooseMarshal(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut)
   at Apache.NMS.ActiveMQ.OpenWire.OpenWireFormat.Marshal(Object o, BinaryWriter ds)
   at Apache.NMS.ActiveMQ.Transport.Tcp.TcpTransport.Oneway(Command command) : Transport connection error: Index and length must refer to a location within the string.
Parameter name: length

Does anybody has any idea what's happening? I am using Apache ActiveMQ version 5.2. (fresh download using their site).

I attempted the identical factor you've here also it appeared to operate. Someone around the intraweb taken care of immediately your request on Nabble that there is a bug (where?) which was fixed. Maybe download the most recent version of Apache.NMS/Apache.NMS.ActiveMQ and check out again.

Apache.NMS includes Spring.NET - that's most likely the very best and simplest method of getting Apache.NMS.

Well, the issue is solved. It required some time but with the aid of the publish that Andy Whitened sent I could have it ready to go just generate an income wanted.

The issue was obviously that individuals libraries presently offered at http://svn.apache.org/viewvc/activemq/activemq-dotnet/ are merely damaged and do not work on all.

Thanks Andy!

Just to reply to the comment "It appears an overkill to utilize a framework that's over 25MB in dimensions simply to send and receive messages from/to some message queue."

I certainly agree which is a real packaging problem, we include put together binaries for .Internet 1.1 through 3. (debug and release develops with .pdbs) reference paperwork, sample applications, and so forth. Should you consider the size the .dlls you have to create an ActiveMQ NMS based Spring.Internet application it's

Common.Logging 28KB, Spring.Aop 152KB, Spring.Core 744KB, Spring.Data 340KB, and Spring.Texting.Nns 104KB for a maximum of ~1.4MB.