Hi Kate, I don't see a work around that you can do for that without a code change. That function should be re-implemented to parse out the pieces that it needs by working from right to left, instead of left to right. If you want to enter a JIRA for this, we can integrate a patch fix for it.
Best, Jim On Mon, Oct 29, 2012 at 10:02 AM, KateMacdonald < [email protected]> wrote: > All our local machines hostnames include a hyphen, e.g. "Machine-M1234". > > This is causing an exception when I try to create a session from a > NetTxConnection as the GuidFromId() method is failing to parse the BrokerId > into a Guid because of this hyphen in the hostname; e.g. > "ID:MACHINE-M123-49158-1351527642035-0:1" > > Renaming all our machines isn't an option. Other than downloading the > source, re-implementing this method and recompiling is there anything > simple > I can do to fix this issue? > > Thanks. > > private static Guid GuidFromId(string id) > { > // Remove the ID: prefix, that's non-unique to be sure > string resId = id.TrimStart("ID:".ToCharArray()); > > // Remaing parts should be host-port-timestamp-instance:sequence > string[] parts = resId.Split(":-".ToCharArray()); > > // We don't use the hostname here, just the remaining bits. > int a = Int32.Parse(parts[1]); > short b = Int16.Parse(parts[3]); > short c = Int16.Parse(parts[4]); > byte[] d = System.BitConverter.GetBytes(Int64.Parse(parts[2])); > > return new Guid(a, b, c, d); > } > > > > -- > View this message in context: > http://activemq.2283324.n4.nabble.com/NMS-NetTxConnection-fails-to-create-a-session-when-hostname-includes-a-hyphen-tp4658395.html > Sent from the ActiveMQ - Dev mailing list archive at Nabble.com. >
